[SOLVED] Problem with lwjgl3 in the new version of JME v3.6.0

I just tried jme3 version 3.6.0 and I got an error when starting the app using lwjgl3, I thought it was the compatibility with my jdk. I tried Java 17-18 and the error persists.

SO: Debian-bullseye

[ Error ]

abr. 15, 2023 6:56:35 P. M. com.jme3.system.JmeDesktopSystem initialize
INFORMACIÓN: Running on jMonkeyEngine 3.6.0-stable
 * Branch: HEAD
 * Git Hash: 53f2a49
 * Build Date: 2023-03-20
Exception in thread "jME3 Main" java.lang.ExceptionInInitializerError
	at org.lwjgl.Sys.createImplementation(Sys.java:129)
	at org.lwjgl.Sys.<clinit>(Sys.java:116)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:220)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.SecurityException: sealing violation: package org.lwjgl is sealed
	at java.base/jdk.internal.loader.BuiltinClassLoader.getAndVerifyPackage(BuiltinClassLoader.java:906)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineOrCheckPackage(BuiltinClassLoader.java:877)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.defineOrCheckPackage(ClassLoaders.java:211)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:849)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at org.lwjgl.LWJGLUtil.loadIcon(LWJGLUtil.java:285)
	at org.lwjgl.LWJGLUtil.<clinit>(LWJGLUtil.java:259)
	... 4 more

With lwjgl if the application is executed.

...
ext.jmonkeyengineVersion = '3.6.0-stable'
...
runtimeOnly 'org.jmonkeyengine:jme3-lwjgl:' + jmonkeyengineVersion

Well, that isn’t lwjgl3, it’s lwjgl2. It sounds like you may have both lwjgl2 and lwjgl3 java packages in your runtime classpath, which will throw sealing errors if a package is sealed, (and would cause other, more subtle errors if the sealing system was not in place.)

Correction:

Sorry if I have caused any confusion, if I use lwjgl2 I am able to run the application. However, if I switch to lwjgl3, that’s where I get the exception.

If it works with:

...
ext.jmonkeyengineVersion = '3.6.0-stable'
...
runtimeOnly 'org.jmonkeyengine:jme3-lwjgl:' + jmonkeyengineVersion

it throws me error:

...
ext.jmonkeyengineVersion = '3.6.0-stable'
...
runtimeOnly 'org.jmonkeyengine:jme3-lwjgl3:' + jmonkeyengineVersion


I already located the origin of the problem, I don't know why but when I implement the library
implementation 'com.github.Jeddic:particlemonkey:1.0.2'

With: LWJGL3

for some reason it doesn’t support the most recent version of the engine or said jar uses lwjgl2 to work, I really don’t know, it’s a shame not to be able to use it right now…

Thank you! :+1:

1 Like

Pretty sure I published a more recent version that removed the lwjgl dependency from the examples.

Edit:
Yea, I have 1.1.0 up on maven. Try updating it.

implementation group: 'com.epagagames', name: 'particlemonkey', version: '1.1.0'
3 Likes

With v1.1.0 there is no problem. Thank you!!!

4 Likes

Awesome, glad to hear it.