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 › errors trying to run in linux
Page Index Toggle Pages: 1
errors trying to run in linux (Read 2968 times)
errors trying to run in linux
Jun 19th, 2009, 12:10pm
 
I have java set up, and processing, unless there's something fancy to do besides decompress the .tgz file.  I'm running Puppy Linux.

Tryign to get the  shell up though is proving difficult.  I got the symlinks set up, but I'm still getting an error.  Last time I tried ./processing I got this message:

Exception in thread "main" java.lang.NoClassDefFoundError: processing/app/Base
Caused by: java.lang.ClassNotFoundException: processing.app.Base
       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:307)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: processing.app.Base.  Program will exit.

What's causing that, and how do I fix it?  I've been working a bit with some poeple who mess with puppy a lot, but they don't know this one, and I'm pretty much a newb.
Re: errors trying to run in linux
Reply #1 - Jun 19th, 2009, 1:43pm
 
can you run the following and post the results:

which java

echo $JAVA_HOME

java -version

sh -x processing
Re: errors trying to run in linux
Reply #2 - Jun 19th, 2009, 2:18pm
 
First did its thing.

Version gives:
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

The last command gives all this:
+ APPDIR=
+ for LIB in java/lib/rt.jar java/lib/tools.jar 'lib/*.jar'
+ CLASSPATH=:/java/lib/rt.jar
+ for LIB in java/lib/rt.jar java/lib/tools.jar 'lib/*.jar'
+ CLASSPATH=:/java/lib/rt.jar:/java/lib/tools.jar
+ for LIB in java/lib/rt.jar java/lib/tools.jar 'lib/*.jar'
+ CLASSPATH=:/java/lib/rt.jar:/java/lib/tools.jar:/lib/antlr.jar
+ for LIB in java/lib/rt.jar java/lib/tools.jar 'lib/*.jar'
+ CLASSPATH=:/java/lib/rt.jar:/java/lib/tools.jar:/lib/antlr.jar:/lib/core.jar
+ for LIB in java/lib/rt.jar java/lib/tools.jar 'lib/*.jar'
+ CLASSPATH=:/java/lib/rt.jar:/java/lib/tools.jar:/lib/antlr.jar:/lib/core.jar:/li
b/ecj.jar
+ for LIB in java/lib/rt.jar java/lib/tools.jar 'lib/*.jar'
+ CLASSPATH=:/java/lib/rt.jar:/java/lib/tools.jar:/lib/antlr.jar:/lib/core.jar:/li
b/ecj.jar:/lib/jna.jar
+ for LIB in java/lib/rt.jar java/lib/tools.jar 'lib/*.jar'
+ CLASSPATH=:/java/lib/rt.jar:/java/lib/tools.jar:/lib/antlr.jar:/lib/core.jar:/li
b/ecj.jar:/lib/jna.jar:/lib/pde.jar
+ export CLASSPATH
+ export PATH=/java/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr
/X11R7/bin:/root/my-applications/bin:/opt/mozilla.org/bin:/opt/samba/bin
+ PATH=/java/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr
/X11R7/bin:/root/my-applications/bin:/opt/mozilla.org/bin:/opt/samba/bin
+ java processing.app.Base
Exception in thread "main" java.lang.NoClassDefFoundError: processing/app/Base
Caused by: java.lang.ClassNotFoundException: processing.app.Base
       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:307)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: processing.app.Base.  Program will exit.

Re: errors trying to run in linux
Reply #3 - Jun 19th, 2009, 2:20pm
 
Just to note, I've symlinked java and javac to  the directory that processing is in.
Re: errors trying to run in linux
Reply #4 - Jun 19th, 2009, 2:32pm
 
Hi,

Your mentioning of symlinks makes me slightly suspicious. Have you tried starting processing from inside its directory? I.e. doing the ./processing in the folder created by unpacking the archive?

If you have created a symlink to the processing binary and try to start from somewhere outside its main folder you would get the error you describe (well, at least I do).


Re: errors trying to run in linux
Reply #5 - Jun 19th, 2009, 3:48pm
 
The symlinks were just for java.  ./processing while in the directory gave the big ugly error.

Java and javac are linked to the processing directory.  Those are the only links.
Re: errors trying to run in linux
Reply #6 - Jun 20th, 2009, 2:27am
 
Code:

export PATH=/java/bin:/bin:/usr/bin:/sbin...


mine (and i'm still on Processing 1.0.3) says
Code:

export PATH=./java/bin:/sbin:/opt/java/bin...

where ./java is the java runtime included with processing and /opt/java is my Sun java install. my JAVA_HOME is set to the Sun java.

i am also confused about the links. can you ls -l them?

mine:
Code:

four:fedora10> ls -l
total 56
drwxr-xr-x 6 1000 1000 4096 2009-02-22 09:57 examples
drwxr-xr-x 7 1000 1000 4096 2008-11-23 01:06 java
drwxr-xr-x 4 1000 1000 4096 2009-02-22 09:57 lib
drwxr-xr-x 9 1000 1000 4096 2009-02-22 09:57 libraries
-rwxr-xr-x 1 1000 1000 266 2009-02-22 09:57 processing
drwxrwxr-x 12 1000 1000 20480 2009-02-21 19:23 reference
-rw-r--r-- 1 1000 1000 8938 2009-02-22 09:56 revisions.txt
drwxr-xr-x 3 1000 1000 4096 2009-02-22 09:57 tools


that java isn't a link. i don't have javac in there.

actually, because of that path, it uses the java  executable and libraries in the included directory, not the sun one. i think your link is hiding this.

Code:

four:fedora10> ls /opt/processing-1.0.3java
bin javaws LICENSE README Welcome.html
COPYRIGHT lib plugin THIRDPARTYLICENSEREADME.txt
Re: errors trying to run in linux
Reply #7 - Jun 20th, 2009, 10:48am
 
Going to the processing directory, and doing the ls -l, I only see the java.  I remember now that the others were linked to something in /usr/bin, but -l isn't showing anything.  I do remember someone suggesting an export $PATH, but I can't remember what it was for.

What exactly is the processing.app.Base?
Re: errors trying to run in linux
Reply #8 - Jun 20th, 2009, 12:12pm
 
the ./processing script should sort out the PATH and CLASSPATH (which we saw with the sh -x) but yours is using /java (absolute path) rather than ./java (java directory under current path) which seems wrong.

> What exactly is the processing.app.Base?

it's the full name of the processing base class. the last line of the processing script is 'java processing.app.Base'

if i just do that i get exactly your error. if i do it via the processing script, which sets up my CLASSPATH and PATH then it works fine. which implies something's not being setup right.
Re: errors trying to run in linux
Reply #9 - Jun 20th, 2009, 12:13pm
 
try this in your processing directory (which is what the script should be doing)

Code:

export CLASSPATH=:./java/lib/rt.jar:./java/lib/tools.jar:./lib/antlr.jar:./lib/core.jar:./lib/ecj.jar:./lib/jna.jar:./lib/pde.jar

export PATH=./java/bin:$PATH

java processing.app.Base


Re: errors trying to run in linux
Reply #10 - Jun 20th, 2009, 12:14pm
 
if that fails, check that everything in the classpath exists

Code:

four:fedora10> ls -l java/lib/rt.jar ./java/lib/tools.jar ./lib/antlr.jar ./lib/core.jar ./lib/ecj.jar ./lib/jna.jar ./lib/pde.jar
-rw-r--r-- 1 1000 1000 50843125 2008-11-23 01:06 java/lib/rt.jar
-rw-r--r-- 1 1000 1000 12490823 2008-11-23 01:08 ./java/lib/tools.jar
-rw-r--r-- 1 1000 1000   443876 2009-02-22 09:56 ./lib/antlr.jar
-rw-r--r-- 1 1000 1000   229715 2009-02-22 09:57 ./lib/core.jar
-rw-r--r-- 1 1000 1000  1647271 2009-02-22 09:56 ./lib/ecj.jar
-rw-r--r-- 1 1000 1000   625227 2009-02-22 09:56 ./lib/jna.jar
-rw-r--r-- 1 1000 1000   692818 2009-02-22 09:57 ./lib/pde.jar


owner, group, dates and file sizes may differ, obv. but sizes should be close

(sorry, the submit button doesn't like it when i post long, complicated things hence the 3 posts)
Re: errors trying to run in linux
Reply #11 - Jun 20th, 2009, 1:53pm
 
PUtting everything in manually worked, actually.  It's working.  I get the impression that the script is supposed to be doing everything itself though.  Here's what the script looks like when I open it with a text editor:
#!/bin/sh

APPDIR="$(dirname -- "${0}")"

for LIB in \
   java/lib/rt.jar \
   java/lib/tools.jar \
   lib/*.jar \
   ;
do
   CLASSPATH="${CLASSPATH}:${APPDIR}/${LIB}"
done
export CLASSPATH

export PATH="${APPDIR}/java/bin:${PATH}"

java processing.app.Base


I'd eventually like to get this fixed and get an entry on the menu, so I don't have to do contortions to open it up.
Re: errors trying to run in linux
Reply #12 - Jun 21st, 2009, 3:06am
 
that's identical to mine

i've added a script to my ~/bin directory (which is in my path) called processing and all it does is cd (pushd actually) into the right place and call the real processing script in there. means i can call it from anywhere (even the menu) just by calling my processing script:

Code:

echo "Using Processing-1.0.3"
pushd /opt/processing-1.0.3
./processing
popd
Page Index Toggle Pages: 1