embert
asked on
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/Arra yList....e tc.".
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?
Thanks,
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
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?
Thanks,
Did you set your classpath to include the classes.zip file for jdk1.1.8? You do not need to do this for Java1.2
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1.1 compiler does not use java.util.ArrayList, so you definitely start some other javac.exe.
ASKER
thanks! the compiler is working ok after I changed the order of classpath. at first, I simply appended c:\jdk1.1.8\lib\classes.zi p to the end of classpath. and it did not work out. here is the original setting:
..c:\jdk1.2.2\lib\tools.ja r;c:\j2sdk ee1.2\lib\ j2ee.jar;c ;\jdk1.1.8 \lib\class es.zip
I guess either tools.jar or j2ee.jar causes the problem?
Ok, problem solved, thanks for help!
Thanks heyhey for your comments.
..c:\jdk1.2.2\lib\tools.ja
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 classes.zip and 1.2 variant of the same class inside tools.jar.
java com.sun.javac.Main
you can find the 1.1 variant of com.sun.javac.Main.class inside classes.zip and 1.2 variant of the same class inside tools.jar.