0

Hi to all,
I am new to JMS concept in java.I have downloaded a example jms program in the site. So i have mention the classpath the java path.The jms program is compiled fine and class file also gernerated.

The problem is when i run the normal java program or any other java program the following error is occured.

JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/
CLASSPATH=/home/prem/j2ee/j2sdkee1.3.1/lib/j2ee.jar

I am using the fedora redhat.

Error Message:
java ex_sample
Exception in thread "main" java.lang.NoClassDefFoundError: ex_sample
Caused by: java.lang.ClassNotFoundException: ex_sample
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)

This error is cleared when i remove the classpath variable .
CLASSPATH IS REMOVED.

1.Can any one say why this error is appearing ?
2.If i am not mentioned the classpath the JMS program is not executed?


Thank you,

With Regards,
Prem

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by NormR1
0

Where is the ex_sample.class file when you execute the 'java ex_sample' command?
Can the java command "see" it? The default classpath is the current directory.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.