Pro-grammer
Pro-grammer

Reputation: 870

Exporting processing to a jar file

I've been working on a processing application using ControlP5 and Twitter4j. I want to have my project run from a single jar file from any operating system. Basically I want to package up my application. My application uses images. I've been browsing for more than an hour, but I cant find how to do this. Any suggestions?

using processing 2 twitter4j3

Thanks in advance!

Upvotes: 3

Views: 2732

Answers (3)

thechaoticpanda
thechaoticpanda

Reputation: 416

This might be old, but i still find other posts about it on processing forums. This is the best way to run processing project as a jar file.

When exporting application, you will always end up with a lib folder inside exported application(whether for Linux and Windows). For windows, open command prompt(or power shell), you can use right-click+shift and then click on open power shell here.

After that you can run the following command. java -classpath lib\* DisplayDepthStream

Now DisplayDepthStream is the name of sketch file.

To explain the command, -classpath lib\* tells java to add everything under lib directory to the class path. And DisplayDepthStream is the name of my main class.

Hope this helps~!

Chears

Upvotes: 1

Pi Studios
Pi Studios

Reputation: 11

So, I know that this post is very old but if you are still looking for a solution, or to other people that see this thread, it's relatively simple.

  1. Export the project
  2. In the folder with the exported project (something like application.windows64), navigate to lib and find core.jar and project name.jar (you need to have file name extensions visible)
  3. Rename the files to .zip files
  4. Extract core.jar to whatever folder
  5. Extract project name.jar into the same folder (make sure you don't do it into a subfolder)
  6. Click yes if it asks if it wants you to replace a file (if it doesn't you extracted the files incorrectly)
  7. Delete core.jar and project name.jar
  8. If the project uses images, move them into the same folder as all the other files
  9. Select all of the files in the folder, right click, hover over send to and select compressed (zipped) folder
  10. Rename the .zip file to name of project.jar

Upvotes: 1

CatsLoveJazz
CatsLoveJazz

Reputation: 869

I dont know if you can directly do it from the Processing IDE however, if export your sketch to a Java applet then locate the .java the the sketch folder you can use this in conjunction with Eclipse to export to a jar file.

Upvotes: 1

Related Questions