Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining the version of Java SDK on the Mac

Tags:

java

macos

I have a MacBook Pro running Snow Leopard; how can I see what version of the Java SDK is installed on my Mac?

like image 620
Ali_IT Avatar asked Jun 07 '10 19:06

Ali_IT


People also ask

How do I know what version of Java SDK I have Mac?

Type terminal in the search bar and open it by clicking on the icon in the search results. 3. Once in the command line, run the command: java -version . The output should display the Java version installed on your MacOS.

How do I check my Java SDK version?

The Java version can be found in the Java Control Panel. Under the General tab in the Java Control Panel, the version is available through the About section. A dialog appears (after clicking About) showing the Java version.

Where is Java SDK installed on Mac?

In macOS, the JDK installation path is /Library/Java/JavaVirtualMachines/jdk-10. jdk/Contents/Home . The root directory of the JDK software installation.

Does Mac come with Java SDK?

The Java Runtime Environment (JRE) is included with 10.8, but the Java Development Kit (JDK) is not - that you'll need to install yourself. Could you provide a link from Apple or any sort of confirmation?


4 Answers

Open a terminal and type: java -version, or javac -version.

If you have all the latest updates for Snow Leopard, you should be running JDK 1.6.0_20 at this moment (the same as Oracle's current JDK version).

like image 135
Jesper Avatar answered Oct 21 '22 02:10

Jesper


In /System/Library/Frameworks/JavaVM.framework/Versions you'll see all the installed JDKs. There is a symbolic link named CurrentJDK pointing the active JDK.

like image 37
Stefan Schmidt Avatar answered Oct 21 '22 03:10

Stefan Schmidt


The simplest solution would be open terminal

$ java -version

it shows the following

java version "1.6.0_65"
  1. Stefan's solution also works for me. Here's the exact input:

$ cd /System/Library/Frameworks/JavaVM.framework/Versions

$ ls -l

Below is the last line of output:

lrwxr-xr-x   1 root  wheel   59 Feb 12 14:57 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

1.6.0.jdk would be the answer

like image 18
Rae Avatar answered Oct 21 '22 02:10

Rae


On modern macOS, the correct path is /Library/Java/JavaVirtualMachines.

You can also avail yourself of the command /usr/libexec/java_home, which will scan that directory for you and return a list.

like image 9
Tim Keating Avatar answered Oct 21 '22 03:10

Tim Keating