Exception in thread "main" java.lang.NoClassDefFoundError
preethi Ayyappan
Ranch Hand
Joined: Oct 04, 2007
Posts: 518
posted
0
Hi,
I am trying to run a program EchoClient.java in a linux machine.It is in the path /usr/src/scripts.I have included mysqlconnector.jar also in that path and i gave the command
Exception in thread "main" java.lang.NoClassDefFoundError: EchoClient1
Caused by: java.lang.ClassNotFoundException: EchoClient1
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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Am i wrong in setting path?please assist me to solve this error.
Thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
By using an explicit "-classpath" switch you're effectively turning off the implicit "." classpath that points to the current directory. If you add that back into it, then it should work: