2

Before I installed Java JDK1.6 on WinXP machine I typed from the CMD line

c:\javac
'javac' is not recognized as internal command ...

Here I concluded I did not have a JDK installation on my PC

So, I installed java 1.6.0_30

c:\javac
Usage: javac <options> <source> files . ....

Conclusion: I now have JDK 1.6 installed

c:\java -version 
java version "1.4.2_06"

Conclusion: I don't have JDK 1.6

Discovery: I have the following files on my hard disk as follows:

c:\DevSuiteHome\jre\1.4.2.\bin\java.exe    -- before I installed JDK 1.6
c:\Program Files\Java\jdk1.6.0_30\java.exe -- recently installed.

My PATH Environment points to both JDKs

 c:\path 
 c:\DevSuiteHome_1\jck\jre\bin;c:\Program Files\Java\jdk1.6.0_30\jre\bin...

Questions: How can I get 'java -version' to reference 1.6.0_30? Can I expect errors with my java code because I have two JDK versions?

1 Answer 1

3

It doesn't point to the one you want. Amend your PATH. Remove both these references.

c:\DevSuiteHome_1\jck\jre\bin;c:\Program Files\Java\jdk1.6.0_30\jre\bin

Add this.

c:\Program Files\Java\jdk1.6.0_30

Now open a cmd prompt, then run java -version and hopefully is 1.6

And no you won't get errors having 2 java versions. It'd only use one or the other.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .