Results 1 to 8 of 8
Exception in thread "main" java.lang.NoClassDefFoundError
Caused by: java.lang.ClassNotFoundException
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:18
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
This ...
- 05-27-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 4
Java error
This is the error while i try to do anything with java... Whats the problem?Exception in thread "main" java.lang.NoClassDefFoundError
Caused by: java.lang.ClassNotFoundException
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:18
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
- 05-27-2008 #2
What, specifically, are you trying to do? You might have just the Java Runtime Environment (JRE) installed and it's looking for the full Java Development Kit (JDK).
Registered Linux user #270181
TechieMoe's Tech Rants
- 05-27-2008 #3
Why would he need the JDK, Moe? This is a runtime exception.
More information is definitely needed, though. Are you trying to run something you wrote and compiled yourself or are you trying to run something you downloaded from somewhere?
- 05-27-2008 #4Just Joined!
- Join Date
- May 2008
- Posts
- 4
I installed JDK, but maybe classpath thing is wrong?
Code:root@server [~]# java -version java version "1.6.0_06" Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode) root@server [~]# which java /usr/bin/java root@server [~]# which javac /usr/bin/javac root@server [~]# echo $JAVA_HOME /usr/local/jdk root@server [~]# echo $PATH /usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/courier-imap/sbin:/usr/lib/courier-imap/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin root@server [~]# echo $CLASSPATH .:/usr/local/jdk/lib/classes.zip
Last edited by techieMoe; 05-27-2008 at 07:36 PM. Reason: Changed "quote" tags to "code" tags.
- 05-27-2008 #5
Ok. What are you launching that causes that error?
Registered Linux user #270181
TechieMoe's Tech Rants
- 05-27-2008 #6Just Joined!
- Join Date
- May 2008
- Posts
- 4
a game server...
this is in run.sh ...killall -9 java
javac *.java
java -Xmx2500m server
but java doesnt react to anything.. always same error...
i can type..
java blabla ..same error
java run.sh ..same error
java heyyooafafr .. same error..
- 05-27-2008 #7
It's complaining because you're trying to run a Java class named 'server'. If you don't have one, it's going to throw a NoClassDefFound exception, which it did. Your Java call should be to the class that contains your "main()" and it is case sensitive.
Also, 2500M is a rather large max heap size. Do you really need that much?
- 05-27-2008 #8Just Joined!
- Join Date
- May 2008
- Posts
- 4
Now it works, i ran wrong command...
But if i do..
- thats in run.shkillall -9 java
javac *.java
java -Xmx2500m server
Also... if i use command
sh ./run.sh
server will start... yay, server is online.. all is fine..
but if i close the SSH client, server will also disconnect... whys that?


Reply With Quote