重新运行-feature以获取详细信息

时间:2014-05-29 05:47:00

标签: scala playframework

当我在Play控制台中编译scala时,我得到了这个:

[warn] there were 1 feature warning(s); re-run with -feature for details
[warn] one warning found

我认为这意味着compile -feature,但我得到了这个:

[error] Expected ID character
[error] Not a valid command: compile (similar: completions)
[error] Expected project ID
[error] Expected configuration
[error] Expected ':' (if selecting a configuration)
[error] Expected key
[error] Expected '::'
[error] Expected end of input.
[error] compile -feature
[error]     

然后我跑play -feature,我得到了这个:

[warn] The `-` command is deprecated in favor of `onFailure` and will be removed in 0.14.0

然后退出。

那我该怎么做呢?

4 个答案:

答案 0 :(得分:38)

你必须添加

scalacOptions += "-feature"
如果您的sbt控制台正在运行(或重新启动),请

build.sbt并执行reload

或者,如果您只想为单个会话设置它,而在sbt控制台中,您可以编写set scalacOptions += "-feature",此设置立即应用,无需重新加载或重新启动sbt控制台。

答案 1 :(得分:10)

如果您已经在play / sbt repl中进行完成,那么只需为会话修改scalacOptions的值,就像这样:

enter image description here

答案 2 :(得分:2)

就我而言,我在文件/ usr / local / etc / sbtopts中找到了我的错误来源。它最后由我安装的一些程序添加了以下行。

-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled XX:MaxPermSize=256M

每当sbt启动时,上面的行作为参数传递,导致上述错误。由于这些是解决它的java选项,我们可以在上面的行之前添加-J或完全删除该行。这摆脱了 - 特征。

答案 3 :(得分:0)

需要将标志添加到Scala编译器选项中。您可以通过在build.sbt文件中添加以下行来执行此操作:

scalacOptions ++= Seq("-feature")
相关问题