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.

I'm having trouble setting the environment path for javac. When I type javac -version from the command prompt it should return

javac 1.7.0_40

However it returns

C:\>javac -version
javac 1.5.0_09
javac: no source files
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  .. etc

Now I am able to get around this by doing the following

c:
cd: C:\Program Files\Java\jdk1.7.0_40\bin
javac -version
javac 1.7.0_40

So this leads me to believe that im donig something wrong with the environment path? This has been appended to the environment list? The command line always boots up in 'z' drive and not 'c' drive could this be part of the issue?

;C:\Program Files\Java\jdk1.7.0_40\bin;

enter image description here

share|improve this question
3  
either remove jdk 5, or make sure the path to jdk 7 occures in your environment path before (to the left of) the jdk 5 path. your path is parsed from left to right, and stops parsing as soon as a match is found. –  Frank Thomas Oct 7 '13 at 16:00

1 Answer 1

up vote 0 down vote accepted

Thanks to feedback from Frank Its been fixed. In the environment list there was

C:\Sun\SDK\jdk\bin

added.. this must have been version 5 or something.. anyways by taking that out it solved the problem.

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.