scalasbtjmonkeyengine

jMonkeyEngine from repo under Scala is crashing


After a lot of time I am going again trying jMonkeyEngine with Scala. This time I wanted properly set sbt and dependencies. Unfortunately there is a lot of issues and discomfort (like having to manually write crazy number of packages jME consists of, no template or something; or jBullet part being broken). I have somehow solved dependency issues in compile time, but when I run hello world app (from first tutorial) I am getting:

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

I was googling around about that exception and it seems something with versions of libraries is broken. But my only dependencies are parts of jME all of same version, so does it mean they (jME guys) have it broken?

Relevant part from 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...

Any ideas how to fix this (without downloading jars and putting them to lib directory)?


Solution

  • It means that the package "org.lwjgl.opengl" is sealed and you try to load another jar containing the same package, you should use either "jme3-lwjgl" or "jme3-lwjgl3" but not both at the same time.