我刚刚升级了我的sbt版本。现在我无法将sbt项目加载到intellij中。我得到的错误表明某些东西正在尝试执行已存储在/ tmp目录下的文件。我的系统配置为阻止任何东西在/ tmp。
下运行我已更新了我的intellij configuration,并将-Djava.io.tmpdir=/path/to/different/directory
选项添加到我过去用过的目录中,以解决此问题,但这还没有帮助
我已尝试设置JAVA_OPTS="-Djava.io.tmpdir=/path/to/different/directory"
环境变量,但这也没有帮助。
如何在intellij上下文中为sbt设置此选项?由于环境变量,我在命令行运行sbt没有任何问题。
intellij版本:2017.3.4
sbt version:1.1.1
Error while importing sbt project:
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
[error] java.lang.UnsatisfiedLinkError: /tmp/jna-94962664/jna6864913840915833425.tmp: /tmp/jna-94962664/jna6864913840915833425.tmp: failed to map segment from shared object: Operation not permitted
[error] at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[error] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
[error] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
[error] at java.lang.Runtime.load0(Runtime.java:809)
...
[error] java.lang.UnsatisfiedLinkError: /tmp/jna-94962664/jna6864913840915833425.tmp: /tmp/jna-94962664/jna6864913840915833425.tmp: failed to map segment from shared object: Operation not permitted
[error] Use 'last' for the full log.
答案 0 :(得分:0)
显然intellij现在支持sbt本机,所以我摆脱了我的旧sbt插件。然后我发现sbt在Build,Execution,Deployment-> sbt-> VM参数下有自己的JVM设置。我添加了-Djava.io.tmpdir
,现在效果很好。