CrazyEngineers
  • How to find out the path of installed JDK

    Updated: Oct 26, 2024
    Views: 1.0K
    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
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • komputergeek

    MemberFeb 27, 2009

    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
    Are you sure? This action cannot be undone.
    Cancel
  • Raviteja.g

    MemberFeb 27, 2009

    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 😉
    Are you sure? This action cannot be undone.
    Cancel
  • shalini_goel14

    MemberFeb 27, 2009

    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.😀
    Are you sure? This action cannot be undone.
    Cancel
  • Yamini L

    MemberFeb 27, 2009

    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??
    Are you sure? This action cannot be undone.
    Cancel
  • shalini_goel14

    MemberFeb 27, 2009

    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?
    Are you sure? This action cannot be undone.
    Cancel
  • Yamini L

    MemberFeb 27, 2009

    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:
    Are you sure? This action cannot be undone.
    Cancel
  • Raviteja.g

    MemberFeb 27, 2009

    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......
    Are you sure? This action cannot be undone.
    Cancel
  • hitesh2008

    MemberApr 5, 2011

    Thanks sir i also wanted to know this
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register