Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.