1

I am a novice Java programmer. I checked existence of Java in my system, I executed Java command in command prompt and I found multiple options. When I executed java -version command, I got below resutl:

java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)

But, I am not able to locate the Java compiler path. How can I locate the path? I am using Windows XP 32 bit system.

Below is the result of PATH command execution:

PATH=C:\RailsInstaller\Git\cmd
C:\RailsInstaller\Ruby1.8.7\bin
c:\oracle\ora92\bin
C:\Program Files\Oracle\jre\1.1.8\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\Program Files\Common Files\Roxio Shared\DLLShared\
C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\
C:\Program Files\Windows Imaging\
C:\Program Files\Enterprise Vault\EVClient\
C:\Program Files\Intel\WiFi\bin\
C:\wamp\bin\php\php5.3.13
C:\software\mysql-proxy-0.8.3-win32-x86\bin
C:\wamp\bin\php\php5.3.13
ursitesion
  • 918
  • 1
  • 14
  • 26

5 Answers5

4

You can use either:

Windows - where java

Linux - which java

As @ursitesion mentioned there was no reason to upvote this. Carelessly I did not read to the part where OP mentioned Windows XP.

Take a look at this users post and upvote his awnser: Is there an equivalent of 'which' on the Windows command line?

Community
  • 1
  • 1
ug_
  • 10,236
  • 2
  • 32
  • 49
  • I executed `Where java` command on command prompt. But, I got below result - `'where' is not recognized as an internal or external command, operable program or batch file.` – ursitesion Jan 27 '14 at 11:00
1

Path to Java Compiler: directory BIN in your Java/JDK 1.7.045. Compiler version: type in command line

javac -version
ionass
  • 11
  • 1
0

in linux whereis java

in windows echo %PATH% and you will see some /bin/java somewhere

and the java compiler is named javac and it should be in the same folder where java ( /bin/java ) is

this is the method I would think of... but I saw that someone already provided a better solution for windows

Alex
  • 2,094
  • 3
  • 24
  • 42
0

I got the answer from below post

unix "which java" equivalent command on windows?

As per the above post, I need to execute the below command in command prompt:

for %i in (java.exe) do @echo. %~$PATH:i

I executed and got below result :

C:\WINDOWS\system32\java.exe

I searched in my system and found that java.exe exist in c:\windows\system32\

Community
  • 1
  • 1
ursitesion
  • 918
  • 1
  • 14
  • 26
0

To locate the Java Compiler Path you have to see the environment Variable.

You can see the "JAVA_HOME" and "PATH" environment variable and that shows the path to the java compiler.

pnathan
  • 713
  • 3
  • 9
  • No, I did not get the path of `JAVA` when I executed `PATH` command. I have updated my question with the result of PATH command execution. – ursitesion Jan 27 '14 at 13:13