yportne13/SpinalResNet

The Security Manager is deprecated and will be removed in a future release

Opened this issue · 1 comments

环境

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

image

尝试探索

  1. 新建scala工程,sbt=1.2.7scala=2.11.12后,build同样失败,报错内容一致。猜测是sbt版本过低的问题。
  2. 新建scala工程,sbt=1.6.2scala=2.11.12后,复制本项目project文件夹并对部分文件做适当修改,可build。然后复制srcweight文件夹即可build

存疑

虽然猜测是sbt版本过低问题,但在另一台电脑上idea打开本项目后可直接build,项目文件夹内有null文件夹(环境不一致,安装了scala和sbt安装包.msi文件。)

另一种解决方法:修改本项目的build.sbtproject/build.properties文件
build.sbt:
EclipseKeys.withSource := true可删可不删,和sbt代理有关。
build.properties:
改成sbt.version=1.6.2

修改代理的方法:参考这里,但阿里仓库地址不应使用旧的,改成https://maven.aliyun.com/repository/public

然后就可以reload sbt project