LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Java runtime error. Exception in thread "main" java.lang.NoClassDefFoundError: / (https://www.linuxquestions.org/questions/red-hat-31/java-runtime-error-exception-in-thread-main-java-lang-noclassdeffounderror-838974/)

Priyadivya 10-19-2010 01:28 AM

Java runtime error. Exception in thread "main" java.lang.NoClassDefFoundError: /
 
Hi

I tried compiling a sample java program in jdk/bin and its working fine in linux box.
I need to run this java program in a different location.
I have set PATH and classpath. But whil running , i get Exception in thread "main" java.lang.NoClassDefFoundError: /
1. javac -classpath <gave the required jar file path here separated by :> Test.java
2. java -classpath <gave the required jar file path here separated by :> . Test

Please help me

paulsm4 10-19-2010 01:52 AM

Common problem.

Especially if you're using packages (which, in general, you definitely should).

It would help if you cut/pasted the full error message. But I think you should be able to figure it out from one of these links (search for "java.lang.NoClassDefFoundError" in each of them):

http://www.jarticles.com/package/package_eng.html

http://forums.sun.com/thread.jspa?threadID=5435982

http://www.java-forums.org/new-java/...ounderror.html

http://download.oracle.com/javase/tu...gingfiles.html

Priyadivya 10-26-2010 05:01 AM

Hi

The pacakge name was missing in the classpath.
Now added and is running fine


All times are GMT -5. The time now is 03:08 PM.