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 › Processing (Beta) with Eclipse
Pages: 1 2 
Processing (Beta) with Eclipse (Read 54942 times)
Re: Processing (Beta) with Eclipse
Reply #15 - May 14th, 2006, 4:26pm
 
Hey all
tried wmli's build file and changed the project name int the properties file and the build.xml file and replaced the pde.jar and core.jar to the the ones im using. It seemed to compile fine (using the terminal command "ant dist"), but when i try to open the html file, the applet fails to load.
The only clues i have is the error message from firefox and safari respectively: "Applet CircleMenus notloaded" and "Applet CircleMenus notinited".

I have zipped up all up, so if anyone has time to take a look (www.ima.zkm.de/~henrik/share/CircleMenus.zip), it would be really appreciated, im not that experienced with advanced compiling stuff.

Otherwise, could anyone tell me how i can get more information on why the applet failed to load, doesnt really give me much feedback to go on.

btw im on macosx 10.4.6 using processing 109.

any help hints or clues would be really appreciated.

Henrik
Re: Processing (Beta) with Eclipse
Reply #16 - May 14th, 2006, 5:33pm
 
hi hendrik,

on os-x you can use safari (not sure about ff) and the console (/applications/utilities/console). java-applets will log their errors there.

or even better:
in the terminal change directory to you applets folder then run:
appletviewer <filename>.html
( replace <..> with the actual name )
if the applet fails to run / load then you will see the error in the terminal ..

best,
F
Re: Processing (Beta) with Eclipse
Reply #17 - May 14th, 2006, 6:12pm
 
hmmm.. the safari stuff worked, apparently it cannot find the main class file, this is what i get in the console:

load: class CircleMenus not found.
java.lang.ClassNotFoundException: CircleMenus
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:168)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:599)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1807)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
at sun.applet.AppletPanel.run(AppletPanel.java:324)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.io.FileNotFoundException: /Users/henrik/My Downloads/CircleMenus/applet/CircleMenus.class (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:280)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:44)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:158)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:155)
... 9 more


any clues?

thanks
Re: Processing (Beta) with Eclipse
Reply #18 - May 14th, 2006, 6:20pm
 
dont worry, figured it out, stupid me forgot to add the package name in the html file. maybe a suggestion for improvement of the buildfile, that it should check the package name of the main class...
anyway, im happy now.
Re: Processing (Beta) with Eclipse
Reply #19 - Feb 15th, 2007, 5:41pm
 
Heya... trying to get this working on my macbook.

After going through the steps as described, and trying the little example app, I get:

Warning: Can't read AppletViewer properties file: /Users/stirman/.hotjava/properties Using defaults.
load: class .class not found.

Any ideas?  Stoked to get Processing running in Eclipse.  REAS, thanks for the steps to help make this happen!
Re: Processing (Beta) with Eclipse
Reply #20 - Mar 1st, 2007, 6:40pm
 
Hello all,
This has helped me getting applets compiled in eclipse, but what about full applications?  Do you *have* to include referenced libraries in  [path to j2sdk]/lib?  I haven't, and trying to compile Toxi's tutorial as an application gives me the following error:


java.lang.ClassNotFoundException: HelloP5

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at processing.core.PApplet.main(PApplet.java:6605)

at processing.HelloP5.main(HelloP5.java:8 )
Re: Processing (Beta) with Eclipse
Reply #21 - Mar 1st, 2007, 8:41pm
 
do you have core.jar in your build path both for the workspace and the compilation?

also, have you set your main class during the pre-build menu?

i had to manually extract the contents of all of my included jar files and place them in my project's final jar. (i.e., copy the "processing" directory from inside core.jar to your project's jar after compiling in eclipse).

if your main class is inside any package other than the default, you must specify when loading it (i.e., "myPackage.MyClass" rather than "MyClass").
Re: Processing (Beta) with Eclipse
Reply #22 - Mar 1st, 2007, 10:31pm
 
I reverted from jsdk 1.5 to 1.4.2, I'm running Processing 0124 on XP, and Eclipse 3.2.2.  When I [Run...]--> and check the classpath, core.jar IS included; in the pre-build menu, I have [processing package]/HelloP5 listed as the main class, as well.  My HelloP5 code is as follows:

<code>
package processing;

import processing.core.*;

public class HelloP5 extends PApplet{


static public void main(String args[]) {

   PApplet.main(new String[] { "HelloP5" });

}  


public void setup(){

 size(1000, 600);

 stroke(155,0,0);

}


public void draw(){


line(mouseX,mouseY,width/2,height/2);

}

}  
</code>

I still get the alert "Could not find the Main Class."  Any clues?  I'm not new to Java, but I'm certainly new to Eclipse (I took a Java class in JBuilder).  I'm also getting a slightly different error now:

java.lang.UnsupportedClassVersionError: processing/HelloP5 (Unsupported major.minor version 49.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"

There's no way that PApplet doesn't allow full application compilation, is there?
Thanks,
Myer
Re: Processing (Beta) with Eclipse
Reply #23 - Mar 1st, 2007, 11:18pm
 
i'm gonna close this thread to avoid it turning into a general eclipse q&a forum.. it was intended to cover an updated tutorial for using processing with eclipse, not a catch-all for eclipse questions... please post separate messages here in the integration board for that.

as for "UnsupportedClassVersionError", a quick search will tell you that you're mixing java 1.4 and java 1.5 code.
Pages: 1 2