Originally Posted by
Scotty
Sorry!
C:\Users\Scotty>cd D:\JAVA
C:\Users\Scotty>javac simple.java
javac: file not found: simple.java
Usage: javac <options> <source files>
use -help for a list of possible options
C:\Users\Scotty>javac D:\JAVA\simple.java
C:\Users\Scotty>cd D:\JAVA\
C:\Users\Scotty>java simple
Exception in thread "main" java.lang.NoClassDefFoundError: simple
Caused by: java.lang.ClassNotFoundException: simple
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
Could not find the main class: simple. Program will exit.
Hey Scotty!
--> C:\Users\Scotty>cd D:\JAVA
This line won't take u to the D:\JAVA location. Instead, it will still be in C:\Users\Scotty.
You need to first go into the D drive by giving
C:\Users\Scotty>D:
and then give the command "cd JAVA"
Now that you are in the required folder. you can directly give
"javac simple.java" followed by
"java simple"
It should solve the problem