
package javap; class HelloWorld { public static void main(String args[]) { System.out.println("hai"); } } i declare a package then in command prompt i set the classpath.After that i compiled the class and run the package then i got the error C:\Users\anitha>set classpath=C:\Program Files\Java\jdk1.6.0_26\lib
C:\Users\anitha>D:
D:>cd javap
D:\javap>set CLASSPATH=C:\Program Files\Java\jdk1.6.0_26\lib
D:\javap>javac HelloWorld.java
D:\javap>java javap.HelloWorld Exception in thread "main" java.lang.NoClassDefFoundError: javap/HelloWorld Caused by: java.lang.ClassNotFoundException: javap.HelloWorld at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: javap.HelloWorld. Program will exit. pls correct me very urgent
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.