Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
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
up vote 1 down vote accepted

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


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

share|improve this answer

You must log in to answer this question.

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