The Security Manager is deprecated and will be removed in a future release
Opened this issue · 1 comments
yzy26353520 commented
环境
win10
idea 2022.2.3,插件有sbt executor、scala
openjdk 免安装,有环境变量
scala2.11.12免安装,有环境变量
遇到的问题
用idea打开本项目,build失败,报错
java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
at java.base/java.lang.System.setSecurityManager(System.java:416)
at sbt.TrapExit$.installManager(TrapExit.scala:53)
at sbt.StandardMain$.runManaged(Main.scala:128)
at sbt.xMain.run(Main.scala:89)
at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
at xsbt.boot.Launch$.run(Launch.scala:149)
at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
at xsbt.boot.Launch$.launch(Launch.scala:159)
at xsbt.boot.Launch$.apply(Launch.scala:44)
at xsbt.boot.Launch$.apply(Launch.scala:21)
at xsbt.boot.Boot$.runImpl(Boot.scala:78)
at xsbt.boot.Boot$.run(Boot.scala:73)
at xsbt.boot.Boot$.main(Boot.scala:21)
at xsbt.boot.Boot.main(Boot.scala)
[error] [launcher] error during sbt launcher: java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
尝试探索
- 新建scala工程,
sbt=1.2.7
,scala=2.11.12
后,build同样失败,报错内容一致。猜测是sbt版本过低的问题。 - 新建scala工程,
sbt=1.6.2
,scala=2.11.12
后,复制本项目project
文件夹并对部分文件做适当修改,可build。然后复制src
、weight
文件夹即可build
存疑
虽然猜测是sbt版本过低问题,但在另一台电脑上idea打开本项目后可直接build,项目文件夹内有null
文件夹(环境不一致,安装了scala和sbt安装包.msi
文件。)
yzy26353520 commented
另一种解决方法:修改本项目的build.sbt
和project/build.properties
文件
build.sbt:
EclipseKeys.withSource := true
可删可不删,和sbt代理有关。
build.properties:
改成sbt.version=1.6.2
修改代理的方法:参考这里,但阿里仓库地址不应使用旧的,改成https://maven.aliyun.com/repository/public
然后就可以reload sbt project