how to get the generated java code (Linux)

edited July 2017 in Using Processing

processing first "compiles" the processing source code to java source code and then runs the java code in the jvm. sometimes it is helpful to see the generated java code. here is how to do so:

  1. open sketch in processing editor.
  2. export application (file menu > export application). this will open a dialog.
  3. confirm exporting in the the dialog.

the sketch is now "exported". in the sketch folder there should now be folders called something like application.linux64. the generated java code is located in the source folder.

example sketch folder:

foobar/foobar.pde

generated java code:

foobar/application.linux64/source/foobar.java

at least for linux it is located there. it should be similar for other operating systems.

you can navigate there manually or let the processing editor open the folder for you (sketch menu > show sketch folder).

you can delete the application.* folders if you don't need them anymore.


here is how to get the generated java code files from command line:

$ processing-java --sketch=foobar --output=exported --export

this will "export" the sketch to a folder named exported in the current directory.

note that you only provide the sketch folder (foobar) and not the .pde file.

the generated java code will be located in:

exported/source/foobar.java

i posted this because i wanted to see the generated java code and searched the forum and only got vague hints how to do so. i managed to do it and now want to share the knowledge. i hope this will help future hackers wanting to see the generated java code.

here are some of the threads with the vague hints:

Sign In or Register to comment.