Search code examples
javaprocessinglaunch4jjsmooth

How can I use JSmooth or Launch4j for Processing?


I am having a little trouble. See, I completed a processing game and I have it exported. Now I bet you know for Processing on a Windows computer, exporting creates 4 other folders: your Data folder you bin and your lib and your source. So I wanted to know if I could combine all of those and have a simple .exe file. So I searched and found this link: https://github.com/processing/processing/wiki/Export-Info-and-Tips, which shows how to do that. It says that I can use JSmooth or Launch4j, and I downloaded and installed both. Now the problem is that both JSmooth and Launch4j ask for the main class. Does processing have a main class? I am pretty sure that is something only for java but I am pretty sure I am wrong. I mean if they said I can use JSmooth and Launch4j, that must mean that it works. I am guessing, in the source file there is a java version of the code that can be run in eclipse. Is that where I can find the main class?


P.S. if you have a question please ask me instead of down-voting immediately if you are confused or if I am missing something. Thank you.


Solution

  • Short answer: the main class is the name of your sketch.

    Longer answer: Behind the scenes, Processing exports as a Java application, and it does create a class file with a main() method. It names that class after your sketch.

    Alternative answer: The latest version of Processing (3.0) allows you to export .exe files directly from the PDE. Just go to file > export, and then check whatever systems you want to export for. You shouldn't have to wrap your own .exe file.

    Shameless self-promotion answer: You can also use the Processing tool JarMatey to create a self-extracting runnable jar out of your Processing sketch.