How to find out the path of installed JDK

A long time back a here asked this question in a very informal way(I mean not in any thread) and he didn't even tried to share its answer also.Well, just now I was trying something and got its answer:

In windows:

Step1: Open command prompt
Step2: Simply type following command
C:\Documents and Settings\shalinig>echo %JAVA_HOME%
It will simply display the path of directory where jdk is installed on your system.

If anyone knows about the command used on Linux. Please share here. πŸ˜€

Thanks

Replies

  • komputergeek
    komputergeek
    In ubuntu we can use whereis command

    whereis java
    But with this we get different paths,corresponding to different files.So instead of this command it is better to use :

    whereis javac
    OR
    locate javac
  • Raviteja.g
    Raviteja.g
    shalini_goel14
    A long time back a here asked this question in a very informal way(I mean not in any thread) and he didn't even tried to share its answer also.Well, just now I was trying something and got its answer:

    In windows:

    Step1: Open command prompt
    Step2: Simply type following command
    It will simply display the path of directory where jdk is installed on your system.

    If anyone knows about the command used on Linux. Please share here. πŸ˜€

    Thanks
    what will it display if there is no jdk installed in our system
    answer with patience for my silly question πŸ˜‰
  • shalini_goel14
    shalini_goel14
    A very good question Raviteja, echo command will work as a normal command so I guess it will print %JAVA_HOME% only in output instead of any path. πŸ˜€

    Please try it on your system and confirm it because on my system JDK is already installed.

    Hope I have answered you. Please correct me if I am wrong.πŸ˜€
  • Yamini L
    Yamini L
    In my system,jdk is already installed..But i am not getting the path..It just prints %JAVA_HOME% in the output instead of pathπŸ˜•....Why is that so??
  • shalini_goel14
    shalini_goel14
    miniy
    In my system,jdk is already installed..But i am not getting the path..It just prints %JAVA_HOME% in the output instead of pathπŸ˜•....Why is that so??
    I guess you have not added JAVA_HOME variable in Environment variables. Please add it

    e.g. JAVA_HOME = C:\Program Files\Java\jdk1.6.0_02\bin in My Computer Properties->Advanced Settings->Environment Variables window.
    Then try that command.

    By the way, is Java working on your system. I mean any java program is working fine?
  • Yamini L
    Yamini L
    Java programs are working..Previously i had done so many.So no problem with that..As you said,JAVA_HOME variable has not been added in that Environmental Variables list..I followed your instructions,added that and now its fine..

    Thanks for clearing my doubt..:smile:
  • Raviteja.g
    Raviteja.g
    yes in my system jdk is installed but the environment vaiable is path so at first it prints %java_home%
    but now it works
    but what about in linux......
  • hitesh2008
    hitesh2008
    Thanks sir i also wanted to know this

You are reading an archived discussion.

Related Posts

HI GUYS, I am a computer engg. Working as IBM INFORMIX Jr. DBA. If U have any talks, discussions, online forums, downloads Pls do post me. Bye
Hi, I am writing a document for the use of the company alone. I have to include the copyright statement. Can anyone give me the proper format of writing a...
Here's latest from BITS APOGEE 2009 APOGEE 09 BITS Pilani Date : 23rd to 27th March The Birla Institute of Technology and Science (BITS), pilani is an institute globally respected...
I remember there were times when if a person was employed with a private firm, he was It later changed as the privately managed organisations started offering more money and...
Hi everyone, Could anyone tell me what is the SEO and and other things related to it iam sorry but iam little new to such things..If I have a website...