Take the 2-minute tour ×

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
  .. 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

1 Answer 1

up vote 0 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

Your Answer


