Home > Blockchain >  sbt assembly cannot create jar getting java.lang.UnsupportedOperationException
sbt assembly cannot create jar getting java.lang.UnsupportedOperationException

Time:04-13

I am using

scala 1.12.10
akka 2.6.3
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.0")

However when executing sbt assembly I am getting:

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:109)
    at sbt.xMain.run(Main.scala:76)
    at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:111)
    at xsbt.boot.Launch$.withContextLoader(Launch.scala:131)
    at xsbt.boot.Launch$.run(Launch.scala:111)
    at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:37)
    at xsbt.boot.Launch$.launch(Launch.scala:120)
    at xsbt.boot.Launch$.apply(Launch.scala:20)
    at xsbt.boot.Boot$.runImpl(Boot.scala:56)
    at xsbt.boot.Boot$.main(Boot.scala:18)
    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

running java 18

java -version
openjdk version "18" 2022-03-22
OpenJDK Runtime Environment (build 18 36-2087)
OpenJDK 64-Bit Server VM (build 18 36-2087, mixed mode, sharing)

CodePudding user response:

It was deprecated and for removal in 17 so in 18 it is not expected to be working ref: https://openjdk.java.net/jeps/411 can you try

System.setSecurityManager(null)

Credits: https://stackoverflow.com/a/67940001/1811348

CodePudding user response:

Using java 8 solved this issue as AminMal suggested

  • Related