Compiler problem(repost)

I have both jdk1.2 and jdk1.1.8 on my local machine. it used to work fine. I meant if I set the path to jdk1.2\bin, I get the version1.2 compiler to compile my program.  If I set the path to jdk1.1.8\bin, I got version1.1.8 compiler.

One day I found I was unable to use jdk1.1.8 compiler, when I set the path to jdk1.1.8\bin, and simply type

C:> javac

I got the following "NoClassDefFoundError:java/util/ArrayList....etc.".
instead of a list of options I can use with the compiler.

  I re-downloaded JDK1.1.8, but the problem still exists.

  I set the path by

  set path=C:\jdk1.1.8\bin;%PATH%

  and using

   java -version

   to confirm the version.

   What is wrong? does anybody meet the same problem?

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

jjdunneConnect With a Mentor Commented:

set classpath=c:\jdk1.1.8\lib\;%CLASSPATH%
Did you set your classpath to include the file for jdk1.1.8?  You do not need to do this for Java1.2
1.1 compiler does not use java.util.ArrayList, so you definitely start some other javac.exe.
embertAuthor Commented:
thanks! the compiler is working ok after I changed the order of classpath.  at first, I simply appended c:\jdk1.1.8\lib\ to the end of classpath.    and it did not work out.  here is the original setting:


I guess either tools.jar or j2ee.jar causes the problem?

Ok, problem solved, thanks for help!

Thanks heyhey for your comments.
javac.exe in fact starts
java com.sun.javac.Main

you can find the 1.1 variant of com.sun.javac.Main.class inside and 1.2 variant of the same class inside tools.jar.

All Courses

From novice to tech pro — start learning today.