How to compile processing file into .class file

edited April 2016 in How To...

Hello I have a processing file that I would like to compile into a .class file. I tried exporting the application using processing itself, then I used javac in the command prompt, referencing the .java file in the source folder of the exported application folder. I got a bunch of errors displayed in cmd about how symbols in my code don't exsist. It sounds to me like the javac compiler doesnt understand processing. What do I do besides rewriting in pure java? Thanks

Tagged:

Answers

  • edited April 2016
    • We can't compile ".pde" but only ".java" files w/ "javac.exe".
    • In Windows, we also need to place "javac.exe" in PATH.
    • Moreover, we need to pass the path of Processing files using "javac.exe"'s -cp option.
  • edited April 2016

    if you look in the libs directory of the exported application there's a jar file with a class in it for your sketch. you'll need that jar AND ALL THE OTHERS in the classpath in order to run it.

    (if you export for linux there's a sh file which is a bit more readable, shows you what you need:

    #!/bin/sh
    APPDIR=$(dirname "$0")
    java -Djna.nosys=true -Djava.library.path="$APPDIR:$APPDIR/lib" \
      -cp "$APPDIR:$APPDIR/lib/Tutorial_14_HelloSplitAll.jar:$APPDIR/lib/core.jar:$APPDIR/lib/jogl-all.jar:$APPDIR/lib/gluegen-rt.jar:$APPDIR/lib/jogl-all-natives-linux-amd64.jar:$APPDIR/lib/gluegen-rt-natives-linux-amd64.jar:$APPDIR/lib/batikfont.jar:$APPDIR/lib/geomerative.jar" \
      Tutorial_14_HelloSplitAll "$@"
    

    note the big classpath)

Sign In or Register to comment.