Intellij not respecting some options in build.sbt

353 views Asked by At

I have an autogenerated SBT project by intellij, in which I am want to add something to java.library.path. I add the following line to the build.sbt:

javaOptions += s"-Djava.library.path=blahblah" Inside my simple scala code, I print the path:

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. Why intellij does not read build.sbt?

1

There are 1 answers

1
AudioBubble On

At my expirience IDEA have very limited support of sbt projects. That was main reason for me to use maven instead (with it's horrible pom xml). While we use sbt our usage of idea was limited by editor features (project was complicated enough to be uncompilable from idea). We may compile assembly and run aps with sbt console utility only.

Sbt is nice modern tool. But support in IDEs is still bad