0

My javac command is not working.

"javac is not recognized as an internal or external command, operable program or batch file."

  1. -java version WORKS
  2. I've tried setting classpath successfully in command prompt. SET CLASSPATH "C:\Program Files\Java\jdk1.7.0_09\bin";
  3. Ive adding it in environment variables. ;C:\Program Files\Java\jdk1.7.0_09\bin ;C:\Program Files\Java\jre7\bin
  4. Ive checked the bin folder java.exe is there aswell as javac.exe.

^ Tried all of these still doesn't work. I've also restarted command prompt still does not not work.

Why is not working?

Rohit Jain
  • 209,639
  • 45
  • 409
  • 525

5 Answers5

3

You're using the correct path apparently, but you should assign it to the PATH variable, not to the CLASSPATH variable.

You're trying to set the access path to the executable files, not to the class files.

ChrisJ
  • 5,161
  • 25
  • 20
2

Just do this

In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.

Festus Tamakloe
  • 11,231
  • 9
  • 53
  • 65
0

Just set JAVA_HOME to

C:\Program Files\Java\jdk1.7.0_09
NimChimpsky
  • 46,453
  • 60
  • 198
  • 311
0

After adding the path to the jre7\bin-Folder to the PATH-Variable, you need to restart your Computer in most cases.

looper
  • 1,929
  • 23
  • 42
0

Did you tried to create a JAVA_HOME variable? The value should be the path of the java without the bin.

Also, try to open Eclipse. If nothing helps, the last thing that you can do is install netbeans, it will configurate everything.

arturvt
  • 641
  • 7
  • 9