Why java.lang.NoClassDefFoundError only with exported sketch?

This relates to the Video Export library.

I was just told that when you export a sketch as executable, it fails to run. It seems to happen at least with Mac and Linux.

This is the error when running the Basic Example:

java.lang.NoClassDefFoundError: com/sun/jna/platform/win32/Wincon
        at basic.setup(basic.java:36)
        at processing.core.PApplet.handleDraw(PApplet.java:2412)
        at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1557)
        at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.platform.win32.Wincon
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 4 more

The example runs fine inside the Processing IDE. With the exported app, it seems to fail before the constructor is called, as I tried printing strings inside setup but nothing is shown in the console.

If you see the error mentions win32, even if this is on Linux or Mac. I make use of JNA in Windows to find out the ffmpeg.exe process and send it a ctrl+c to close it gracefully.

Any ideas for what I could try?

Answers

Sign In or Register to comment.