We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Exporting an application with Eclipse
Page Index Toggle Pages: 1
Exporting an application with Eclipse? (Read 1099 times)
Exporting an application with Eclipse?
Nov 10th, 2007, 6:57am
 
I just started using Eclipse with Processing and was trying to make it export an application. I followed the instructions at http://www.mostpixelsever.com/tutorial/eclipse. After using that page's simple test code, I used the Export menu with the "Mac OS X application bundle" option, with the main class as the class that extends PApplet, a suitable app name and folder location, and JVM 1.5. However, when I try to run the exported application, OS X refuses to launch the app because it is 'damaged or incomplete.'

I am not very knowledgeable about the way Java libraries work, so I may be missing something obvious.

Oh, and 'Run as Java Application' works just fine.

Edit: I tried exporting it as a Java applet as well, and that didn't work either, though with different results. It left this error message on the console: "Failed to load Main-Class manifest attribute from
/Users/stephen/Desktop/ProcessingTestbed.jar"

Any help is greatly appreciated.

My code:
Code:
import processing.core.*;

public class ProcessingTestbed extends PApplet{
public static void main(String args[]) {
PApplet.main(new String[] { "--present", "ProcessingTestbed" });
}

public void setup(){
size(200, 200);
stroke(155,0,0);
}

public void draw(){
background(255);
line(mouseX,mouseY,width/2,height/2);
}

}
Re: Exporting an application with Eclipse?
Reply #1 - Nov 11th, 2007, 4:09am
 
Get the Fat Jar plugin for eclipse

http://fjep.sourceforge.net/

It will export a jar from which you can run java -jar yourjarname.jar class yourclassname

You can then pack that command line up as a bash shell script or something so people can run it easier (not sure how to make a double-clickable though).
Re: Exporting an application with Eclipse?
Reply #2 - Nov 13th, 2007, 3:19am
 
I had tried Fat Jar with the same results. I was under the impression that in OS X, if you double-click a jar, it will be automatically run with the main class. There was, at least, a field in the OS X app export wizard for the main class.
Re: Exporting an application with Eclipse?
Reply #3 - Nov 29th, 2007, 10:28am
 
Nope.. not that I know of yet. One day I'll find this "double-click java" magic for fat-jar processing apps. Until then, my method works.
Re: Exporting an application with Eclipse?
Reply #4 - Nov 29th, 2007, 9:29pm
 
You can re-package a JAR file into a MacOS .app. I've described the process on my blog.
Re: Exporting an application with Eclipse?
Reply #5 - Dec 1st, 2007, 2:57pm
 
Sweet! Thanks Marius! Rock on.
Page Index Toggle Pages: 1