I am no longer able to compile any
java code. I was working on the JavaRanch Cattle Drive
Servlets exercise and followed the
J2EE SDK link to download page. I got the JavaEE 6 version. Since installing it I can no longer compile. I am stuck. Thanks for your help. I've been enjoying the cattle drive so far.
Here's the message and the java code:
C:\JAVA\MyApps>javac HelloWorld.java
Exception in
thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: com.sun.tools.javac.Main. Program will exit.
C:\JAVA\MyApps>java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)