I want to make my code run from command prompt
I am using window 7 and JDK 6
Following are steps I did:
1) Created a Text file Example.txt. Changed the file extension to Example.java and placed it under C:\myWork
2) Open command prompt type 'dir' to see all the file in 'myWork'.
3) created a class file as Example.class from exmaple.java by javac Example.java
4) Finally on running command 'java Example'. it does work as desired as it does not print "hello world" and shows an exception "Exception in thread "main" NoClassDefFoundError: Example
Caused by: java.lang.ClassNotFoundException: Example
I dont undertsand this exception is occuring ..:(. How should i Run it successfully??? what is that i am doing wrong or missing something
Thanks in advance!!!!!!!!!!
Edited 4 Years Ago by myadav