简体   繁体   English

Intellij不尊重build.sbt中的某些选项

[英]Intellij not respecting some options in build.sbt

I have an autogenerated SBT project by intellij, in which I am want to add something to java.library.path . 我有一个由intellij自动生成的SBT项目,我想在其中添加一些内容到java.library.path I add the following line to the build.sbt: 我将以下行添加到build.sbt中:

javaOptions += s"-Djava.library.path=blahblah" Inside my simple scala code, I print the path: javaOptions += s"-Djava.library.path=blahblah"在我的简单Scala代码中,我打印了路径:

object JniExampleScala {
    def main(args: Array[String]) {
      System.out.println(System.getProperty("java.library.path"))
    }
}

When running from command line ( sbt compile and sbt run ), it prints the path blahblah , but when running inside intellij, it prints the default path. 从命令行运行时( sbt compilesbt run ),它打印路径blahblah ,但是在intellij内部运行时,它打印默认路径。 Why intellij does not read build.sbt? 为什么intellij不读取build.sbt?

At my expirience IDEA have very limited support of sbt projects. 以我的经验,IDEA对sbt项目的支持非常有限。 That was main reason for me to use maven instead (with it's horrible pom xml). 这是我改用Maven的主要原因(这是可怕的pom xml)。 While we use sbt our usage of idea was limited by editor features (project was complicated enough to be uncompilable from idea). 当我们使用sbt时,我们对想法的使用受到编辑器功能的限制(项目非常复杂,无法从想法中进行编译)。 We may compile assembly and run aps with sbt console utility only. 我们可能仅使用sbt控制台实用程序编译程序集并运行aps。

Sbt is nice modern tool. Sbt是很好的现代工具。 But support in IDEs is still bad 但是IDE的支持仍然很差

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM