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 › importing processing library
Page Index Toggle Pages: 1
importing processing library (Read 962 times)
importing processing library
Feb 1st, 2008, 5:06pm
 
I see this on the FAQ page " ... core.jar file from the Processing distribution to develop your own sketches with other environments ..."

I can also see from examples created with Processing..
Code:

import processing.core.*;
.
.
class Sketch extends PApplet {
.
.
.
}


My aim is to use processing.core.* and processing.opengl.* outside of the Processing environment.

I'm using a mac and have found Processing's core.jar and opengl folder.

Must these be dropped into the Library/Java/Extensions directory or is there an alternative (for people without admin rights)?

Thanks in advance,
Re: importing processing library
Reply #1 - Feb 1st, 2008, 6:17pm
 
I have extracted core.jar files to desktop/processing/core/ and then created the following desktop/Sketch.java

Code:

import processing.core.*; import java.applet.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; import java.io.*; import java.net.*; import java.text.*; import java.util.*; import java.util.zip.*;

class Sketch extends PApplet  {

public void setup(){
size(500,500);
}

public void draw(){
background(0);
}

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

}


Runtime error
java.lang.IllegalAccessException: Class processing.core.PApplet can not access a member of class Sketch with modifiers "public"
       at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
       at java.lang.Class.newInstance0(Class.java:344)
       at java.lang.Class.newInstance(Class.java:303)
       at processing.core.PApplet.main(PApplet.java:6943)
       at Sketch.main(Sketch.java:18 )

Could someone please help me to get started?
Re: importing processing library
Reply #2 - Feb 1st, 2008, 6:27pm
 
WHOOOOOOO! It works Smiley

Ok, now how do I add processing.opengl.*? Smiley
Re: importing processing library
Reply #3 - Apr 13th, 2008, 11:29pm
 
What did you do about the "Class processing.core.PApplet can not access a member of class Sketch" error?
Page Index Toggle Pages: 1