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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Did you set your classpath to include the file for jdk1.1.8?  You do not need to do this for Java1.2

set classpath=c:\jdk1.1.8\lib\;%CLASSPATH%

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.