activityworkshop / GpsPrune

GpsPrune is a map-based application for viewing, editing and converting coordinate data from GPS systems.
GNU General Public License v2.0
67 stars 22 forks source link

Exception in thread "J3D-Renderer-1" (with workaround) #105

Closed sm8ps closed 1 week ago

sm8ps commented 1 week ago

When launching 3d-view, GpsPrune chokes on the following:

Exception in thread "J3D-Renderer-1" java.lang.IllegalAccessError: class javax.media.j3d.X11NativeConfigTemplate3D (in unnamed module @0x6ce2b319) cannot access class sun.awt.X11GraphicsConfig (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @0x6ce2b319
    at javax.media.j3d.X11NativeConfigTemplate3D.getBestConfiguration(X11NativeConfigTemplate3D.java:75)
    at javax.media.j3d.NativePipeline.getBestConfiguration(NativePipeline.java:3335)
    at javax.media.j3d.Renderer.doWork(Renderer.java:514)
    at javax.media.j3d.J3dThread.run(J3dThread.java:275)

This happens on Ubuntu 24.04 with version 23.2 (build 408). After some research, I found that launching it from the command-line with the following Java-options does work:

JAVA_OPTS='--add-opens=java.desktop/sun.awt=ALL-UNNAMED' gpsprune

Is there any better way to fix this error? Thanks for this great application!

activityworkshop commented 1 week ago

You're correct, but it also depends on which java version you're using.

There's a bug on Debian about exactly this: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068172 and it was resolved by modifying the launch command exactly as you described. So one solution would be for you to install Debian's package of 24.1 (I know it's normally a really bad idea to install Debian packages on Ubuntu but in this case it's fairly risk-free I believe, and it worked fine last time I tried it), or just copy Debian's launch script /usr/bin/gpsprune.

sm8ps commented 1 week ago

Many thanks for your quick answer, @activityworkshop ! Good to know that the error is already taken care of. I shall adapt the launch script accordingly. Maybe this issue here can serve others facing the same issue.