0

For the command java -version, I am getting no error. But when i am trying to execute the "javac -version" I am getting an error " Javac is not recognized as an internal or external command "

  • Look in Programs and Features? – user253751 May 04 '15 at 07:06
  • You want to check for availablilty of Java compiler or Java runtime? – TheLostMind May 04 '15 at 07:06
  • open command prompt and type java -version to check whether java is installed or not and then create an environment variable named as "path" and variable value as "c:\java\bin" // the path of java bin in local directory or remote directory – Sagar Rout May 04 '15 at 07:11
  • 1
    Note that there is a difference between JDK and JRE. `javac` belongs to JDK, so it is entirely possible that "Java is installed" (in the sense that you have JRE) and "javac is not installed". – Sergei Tachenov May 04 '15 at 07:34

3 Answers3

1

After you installed JAVA JDK you need to set your Environment variables properly.

Right Click on the Windows Button on the lower left > System > Advanced System Settings > click on the Advanced tab, then click the Environment Variables button

You have to Edit the PATH variable and the JAVA_HOME properly.

Here you have further Informations

B. Kemmer
  • 1,517
  • 1
  • 14
  • 32
0

From the error message it appears that you are in Windows. The reason why java works but not javac is most probably that "javac" is not part of the build (JRE) which provided "java".

If you install a "JRE" as opposed to "SDK" you get only the essentials to run a Java program, but not the ones which help you build an application.

In contrast, SDK provides the full toolset including javac.

To confirm, you can check where "java.exe" is present, and see if the folder structure is part of a JRE or an SDK.

If you don't know from where "java.exe" is being picked up, you can check in the installed software section within the control panel.

If you don't find any entry of java in the control panel, you can check the folders contained in the %PATH% environment variable and see where java.exe is present.

Gireesh Punathil
  • 1,344
  • 8
  • 18
0

Running the command java -version

Shows the java installed in the machine. Sometimes this command fails when JAVA_HOME and JRE_HOME is not set in the windows environment. Please check the program files folder and check for folder name starts with java. if java installed then you could see the java folder in it.

Mohan Raj
  • 1,104
  • 9
  • 17