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 › Using Processing in BlueJ
Page Index Toggle Pages: 1
Using Processing in BlueJ (Read 2164 times)
Using Processing in BlueJ
Feb 26th, 2010, 5:16am
 
I would like to be able to use Processing from within BlueJ (www.blueJ.org). I teach Java programming using this IDE and the students have expressed an interest in creating some Processing sketches and since one of the goals is to show how this fits within the Object-Oriented modelling context, I don't want to use the Processing IDE.

Linking BlueJ to core.jar is fine, and I'm happy to cover the difference between 'raw' Java programming of Processing vs the pre-processing that is handled in the Processing IDE (color int/classes; floats for numeric literals etc). Compiling code is fine.

The problem is that I cannot get the application or applet to run from within BlueJ. So using a simple starter class such as

public class RunSketch
{
   public static void main(String[] args)
   {  
       PApplet.main(new String[] {"SimpleSketch"});
   }
}


Generates a runtime error which appears to be due to ClassLoader problems (see the error trace below). I suspect that this is due to the fact that BlueJ creates two VMs, one for the IDE and one for the code within it. The same compiled code works without a problem when run from the command line or from within Eclipse (ie outside of BLueJ).

Does anyone know how I might go about fixing this (without compiling an adapted version of PApplet.java)?  I note that this type of problem has been reported before on the forum, but see no solutions.

Thanks.

Jo.


java.lang.RuntimeException: java.lang.ClassNotFoundException: SimpleSketch
     at processing.core.PApplet.main(PApplet.java:6686)
     at RunSketch.main(RunSketch.java:20)
Caused by: java.lang.ClassNotFoundException: SimpleSketch
     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
     at processing.core.PApplet.main(PApplet.java:6683)
     at RunSketch.main(RunSketch.java:20)
     at __SHELL0.run(__SHELL0.java:7)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at bluej.runtime.ExecServer$3.run(ExecServer.java:814)
/Users/jwo/teaching/inm350Java/processing/Processing
java.lang.RuntimeException: java.lang.ClassNotFoundException: SimpleSketch
     at processing.core.PApplet.main(PApplet.java:6686)
     at RunSketch.main(RunSketch.java:20)
Caused by: java.lang.ClassNotFoundException: SimpleSketch
     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
     at processing.core.PApplet.main(PApplet.java:6683)
     at RunSketch.main(RunSketch.java:20)
     at __SHELL2.run(__SHELL2.java:7)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at bluej.runtime.ExecServer$3.run(ExecServer.java:814)
Re: Using Processing in BlueJ
Reply #1 - Jun 2nd, 2010, 9:36am
 
have you manage to fix it? i am having kind the same problem.
Page Index Toggle Pages: 1