Skip to content
Fix Code Error

How do I find where JDK is installed on my windows machine?

March 13, 2021 by Code Error
Posted By: Anonymous

I need to know where JDK is located on my machine.

On running Java -version in cmd, it shows the version as ‘1.6.xx’.
To find the location of this SDK on my machine I tried using echo %JAVA_HOME% but it is only showing ‘JAVA_HOME’ (as there is no ‘JAVA_PATH’ var set in my environment variables).

Solution

If you are using Linux/Unix/Mac OS X:

Try this:

$ which java

Should output the exact location.

After that, you can set JAVA_HOME environment variable yourself.

In my computer (Mac OS X – Snow Leopard):

$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxr-xr-x  1 root  wheel  74 Nov  7 07:59 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

If you are using Windows:

c:> for %i in (java.exe) do @echo.   %~$PATH:i
Answered By: Anonymous

Related Articles

  • How do I install Java on Mac OSX allowing version switching?
  • Get operating system info
  • I need to extract working hour breaks out of a Time…
  • Simplest way to create Unix-like continuous pipeline in…
  • Downloading Java JDK on Linux via wget is shown license page…
  • How can I find the product GUID of an installed MSI setup?
  • How to install the Raspberry Pi cross compiler on my Linux…
  • Failed to find 'ANDROID_HOME' environment variable
  • Change the location of the ~ directory in a Windows install…
  • Postgres could not connect to server

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

C++ IDE for Linux?

Next Post:

How to do a logical OR operation for integer comparison in shell scripting?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Get code errors & solutions at akashmittal.com
© 2022 Fix Code Error