Export sketch to jar

Is it possible to export a processing sketch as a jar, or to turn the exported files into an executable jar? I tried following the instructions here https://forum.processing.org/one/topic/getting-processing-to-export-as-a-executable-jar#25080000001605035.html, but when I tried to open the jar, it said the file was corrupt.

1 Like

You can still use Export Application and export it for any single platform. I haven’t used Processing for a while, but from my Java knowledge I can tell that if you unpack all the files from the JARs in the application.(platform)/lib folder into a single directory, and then pack all those files into a JAR file, the end result is likely to work like that. I never peeked into a Processing-generated JAR, so I’m not sure if it contains the META-INF/MANIFEST.MF file, which is required to run your application using a double-click (or java -jar from the CLI).

1 Like

I try that, and I get this error:

error

What’s the folder structure of your final JAR file?

When I was opening the jar to check, I found the issue. I compressed the entire folder, so the jar contained a folder with all of the files inside, instead of just the files. Thanks for your help!

2 Likes