Processing 4 core - P2D & P3D not working

A few days ago, Processing 4* suddenly stopped being able to run any p2D and p3D sketches.
Upon running the error below displays…

Warning: Caught Exception while retrieving executable temp base directory:
java.io.IOException: Could not determine a temporary executable directory
	at com.jogamp.common.util.IOUtil.getTempDir(IOUtil.java:1336)
	at com.jogamp.common.util.cache.TempFileCache.<clinit>(TempFileCache.java:84)
	at com.jogamp.common.util.cache.TempJarCache.initSingleton(TempJarCache.java:96)
	at com.jogamp.common.os.Platform$1.run(Platform.java:313)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.common.os.Platform.<clinit>(Platform.java:290)
	at com.jogamp.nativewindow.NativeWindowFactory$1.run(NativeWindowFactory.java:239)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.nativewindow.NativeWindowFactory.<clinit>(NativeWindowFactory.java:236)
UnsatisfiedLinkError: Can't load library: C:\Users\willi\Desktop\Utility\processing-4.0a3\natives\windows-amd64\\gluegen_rt.dll
A library relies on native code that's not available.
	at com.jogamp.newt.NewtFactory$1.run(NewtFactory.java:69)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
Or only works properly when the sketch is run as a 32-bit application.
	at com.jogamp.newt.NewtFactory.<clinit>(NewtFactory.java:66)
	at processing.opengl.PSurfaceJOGL.initIcons(PSurfaceJOGL.java:574)
	at processing.opengl.PSurfaceJOGL.initFrame(PSurfaceJOGL.java:212)
	at processing.core.PApplet.initSurface(PApplet.java:10858)
	at processing.core.PApplet.runSketch(PApplet.java:10766)
	at processing.core.PApplet.main(PApplet.java:10518)
java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\willi\Desktop\Utility\processing-4.0a3\natives\windows-amd64\\gluegen_rt.dll
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
	at java.base/java.lang.Runtime.load0(Runtime.java:768)
	at java.base/java.lang.System.load(System.java:1837)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:625)
	at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)
	at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:107)
	at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:488)
	at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:427)
	at com.jogamp.common.os.Platform$1.run(Platform.java:321)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.common.os.Platform.<clinit>(Platform.java:290)
	at com.jogamp.nativewindow.NativeWindowFactory$1.run(NativeWindowFactory.java:239)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.nativewindow.NativeWindowFactory.<clinit>(NativeWindowFactory.java:236)
	at com.jogamp.newt.NewtFactory$1.run(NewtFactory.java:69)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.jogamp.newt.NewtFactory.<clinit>(NewtFactory.java:66)
	at processing.opengl.PSurfaceJOGL.initIcons(PSurfaceJOGL.java:574)
	at processing.opengl.PSurfaceJOGL.initFrame(PSurfaceJOGL.java:212)
	at processing.core.PApplet.initSurface(PApplet.java:10858)
	at processing.core.PApplet.runSketch(PApplet.java:10766)
	at processing.core.PApplet.main(PApplet.java:10518)

Processing is unable to create a temp folder of some sort somewhere, causing the native libraries to be missing. Does anyone know what might have caused this? I’ve searched online and all I could find was todo with an old antivirus bug from 2015. Ive checked my PATH which has a TEMP entry to the correct folder, AppData\Local\Temp has the correct perms, redownloaded latest processing, disabled all AV, etc

*Unusally Processing 3 does not seem to have this problem, leading me to suspect its todo with the jogamp/gluegen native libraries. Using the gluegen from the JOGL website or Processing 3 core causes reflection errors in Processing 4 so something must’ve changed.

You could experiment by creating your own temporary files. It is possible to change temporary folder used by java with a command line arguments. I was interested with your error codes, as I thought going forward processing was only going to support 64 bit OS, yet there is complaint about only working with a 32 bit application?

Im not sure, since this is the temporary file created by Jogamp, the code for determining the location can be found here: gluegen/IOUtil.java at master · sgothel/gluegen · GitHub
Its failure to create a file concerns me, System.getenv(“TEMP”) isn’t null by any means. I cant put gluegen-rt.dll into a pre-made natives folder since its a generated dll file.
As for 64/32 bit, this is 64 bit processing running on 64bit system, that error stems from the generated natives file failing to show up from the temp directory not being avaliable.

Unfortunately I’m a linux man myself so I can’t really test anything for you however afaik *.dll files are provided in jogl.jars. The temporary files that are cached on my system where I have _JAVA_OPTIONS: -Djava.io.tmpdir=/home/tux/tmp when I run P2D sketches is a folder /home/tux/tmp/jogamp_0000/file_cache containing a lock file and a subfolder with the *.so natives (equivalent of *.dll) nested in natives/linux-amd64 sub-folders. Perhaps there’s an error in naming of sub-folder?

see setting java options, anyway as you’ve identified it might be a jogamp issue specific to windows.

It seems Runner.java generates lots of daft error messages that are misleading.

1 Like

Jogamp also allows for loading the native libraries directly, so you could manually extract them, then figure out where they need to be to be picked up. Possibly alongside the JARs will work, but might require looking at the Jogamp docs, and possibly require launching with system properties and/or environment variables.

1 Like

Yep, solution was to run Processing in an external IDE with the dll’s ripped out of the native jars and library path set.