来自 Scala 下 repo 的 jMonkeyEngine 正在崩溃

jMonkeyEngine from repo under Scala is crashing

经过很多时间,我再次尝试使用 Scala 的 jMonkeyEngine。这次我想正确设置 sbt 和依赖项。不幸的是,有很多问题和不适(比如必须手动编写数量惊人的 jME 包,没有模板或其他东西;或者 jBullet 部分被破坏)。我在编译时以某种方式解决了依赖性问题,但是当我 运行 hello world 应用程序(来自第一个教程)时,我得到:

Exception in thread "main" java.lang.SecurityException: sealing violation: package org.lwjgl.opengl is sealed

我在谷歌上搜索了那个异常,似乎库版本的东西坏了。但是我唯一的依赖项是 jME 的所有相同版本的部分,所以这是否意味着他们(jME 家伙)已经坏了?

来自build.sbt的相关部分:

// resolvers += Resolver.sonatypeRepo("snapshots")

resolvers += Resolver.jcenterRepo

resolvers += Resolver.bintrayRepo("jmonkeyengine", "org.jmonkeyengine")

val jmeVersion = "3.1.0-stable"

libraryDependencies += "org.jmonkeyengine" % "jme3-android-native" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-android" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-core" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-desktop" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-effects" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-jogg" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-jogl" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-lwjgl" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-lwjgl3" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-networking" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-niftygui" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-plugins" % jmeVersion

libraryDependencies += "org.jmonkeyengine" % "jme3-terrain" % jmeVersion

//libraryDependencies += "org.jmonkeyengine" % "jme3-jbullet" % jmeVersion //  not working, added it to lib dir...

知道如何解决这个问题(无需下载 jar 并将它们放入 lib 目录)吗?

这意味着包 "org.lwjgl.opengl" 是 sealed 并且您尝试加载另一个包含相同包的 jar,您应该使用 "jme3-lwjgl" 或 "jme3-lwjgl3" 但不是两者同时进行。