Copy/usr/libexec/java_home -V

lists one line per Java environment installed (and known to the /usr/bin/java command).

You can still have other Java distributions which are not registered. They are typically downloaded as ZIP files without an installer, or using another package manager like homebrew.

Answer from Thorbjørn Ravn Andersen on Stack Overflow
🌐
Codemia
codemia.io › knowledge-hub › path › see_all_the_java_versions_installed_on_mac
See all the Java versions installed on Mac
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
Oracle
java.com › en › download › help › version_manual.html
How to find Java version in Windows or Mac - Manual method
Java 8 Update 111). Older versions may be listed as Java(TM), Java Runtime Environment, Java SE, J2SE or Java 2. ... Right-click on the screen at bottom-left corner and choose the Control Panel from the pop-up menu. ... The installed Java version(s) are listed.
🌐
Mac Install Guide
mac.install.guide › java › version
Check Java Version on Mac · Mac Install Guide · 2026
How to check Java version on Mac with java -version in terminal. Find your JDK location, list all installed Java versions, and solve macOS Java problems.
🌐
Code2care
code2care.org › home › q › how to get list of all java versions installed on macos
How to get list of all Java versions installed on macOS | Code2care
January 26, 2026 - In order to know that versions of Java have been installed on a Mac computer running macOS is to run the command: /usr/libexec/java_home -V
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check java version on mac
How to Check Java Version on Mac (2 Simple Options)
December 16, 2025 - Finding the installed Java version on macOS requires using the command line. Java versions 10 and earlier also included the Java Control Panel GUI applet, which displayed the installed version in a graphical interface. However, the applet was discontinued as part of efforts to reduce complexity and simplify Java maintenance. The following sections provide instructions for checking the Java version on macOS.
🌐
Wikihow
wikihow.com › computers and electronics › software › programming › java › how to check java version on a mac: 2 simple methods
How to Quickly and Easily Check Java Version on a Mac
September 28, 2025 - Learn how to check what version of Java your Mac is running This wikiHow will teach you how to check what version of Java you have installed on your Mac by checking the System Settings or by using your Mac's Terminal. These methods will...
🌐
Medium
medium.com › @manvendrapsingh › installing-many-jdk-versions-on-macos-dfc177bc8c2b
Installing & switching between multiple JDK on macOS | by Manvendra P Singh | Medium
February 20, 2023 - On any machine, the easiest way to check the current java version is by java -version · You can also check all installed java versions on macOS by java_home /usr/libexec/java_home -V
Find elsewhere
🌐
Delft Stack
delftstack.com › home › howto › java › check java version mac
How to Check Java Version in Mac | Delft Stack
March 11, 2025 - Another effective method to check your Java version is by using the java_home command in the Terminal. This command provides information about the installed Java versions on your Mac.
Top answer
1 of 2
17

Mac OS X has a cool binary (/usr/libexec/java_home) that returns the path to a Java home directory from the current user's settings. You may want to issue:

Copy/usr/libexec/java_home -V

It prints the full JVM list with architectures like this:

CopyMatching Java Virtual Machines (2):
    13, x86_64: "OpenJDK 13"    /Library/Java/JavaVirtualMachines/openjdk-13.jdk/Contents/Home
    1.8.0_265, x86_64:  "AdoptOpenJDK 8"    /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/openjdk-13.jdk/Contents/Home

If you want to print the JAVA_HOME path of a specific JDK version, you can do it like this:

Copy/usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

You can see the complete usage options of below:

CopyUsage: java_home [options...]
    Returns the path to a Java home directory from the current user's settings.

Options:
    [-v/--version   <version>]       Filter Java versions in the "JVMVersion" form 1.X(+ or *).
    [-a/--arch      <architecture>]  Filter JVMs matching architecture (i386, x86_64, etc).
    [-d/--datamodel <datamodel>]     Filter JVMs capable of -d32 or -d64
    [-t/--task      <task>]          Use the JVM list for a specific task (Applets, WebStart, BundledApp, JNI, or CommandLine)
    [-F/--failfast]                  Fail when filters return no JVMs, do not continue with default.
    [   --exec      <command> ...]   Execute the $JAVA_HOME/bin/<command> with the remaining arguments.
    [-R/--request]                   Request installation of a Java Runtime if not installed.
    [-X/--xml]                       Print full JVM list and additional data as XML plist.
    [-V/--verbose]                   Print full JVM list with architectures.
    [-h/--help]                      This usage information.
2 of 2
3

You can use the java_home binary for this task.

/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. java_home is one such binary, calling it with option -V will print full JVM list with architectures.

Copy     /usr/libexec/java_home -V
🌐
javaspring
javaspring.net › blog › see-all-the-java-versions-installed-on-mac
How to See All Java Versions Installed on Mac: Terminal Command to List JREs — javaspring.net
This blog will guide you through step-by-step terminal commands to list all Java versions (including JREs and JDKs) installed on your macOS system. We’ll cover built-in tools, directory checks, and third-party package managers like Homebrew, ensuring you can confidently identify every Java runtime on your machine.
🌐
Stack Overflow
stackoverflow.com › questions › 62947534 › how-to-see-all-versions-of-java-installed-on-macos
How to see all versions of Java installed on macOS? - Stack Overflow
July 17, 2020 - ❯ java --version java 14.0.1 2020-04-14 Java(TM) SE Runtime Environment (build 14.0.1+7) Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing) ❯ /usr/libexec/java_home -V Matching Java Virtual Machines (3): 14.0.1, x86_64: "Java SE 14.0.1" /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home 13.0.1, x86_64: "Java SE 13.0.1" /Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home 11.0.5, x86_64: "AdoptOpenJDK 11" /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home ... Commenting because I'm not on my MacBook so I can't confirm for sure, but I believe the JCP is showing you information about JRE and not JDK. To see your JDK version, try this answer: stackoverflow.com/questions/36766028/… ... Only one JRE can be installed on the system at any time.
🌐
CodingTechRoom
codingtechroom.com › question › list-installed-java-versions-mac
How to List All Installed Java Versions on a Mac - CodingTechRoom
Open the Terminal application on your Mac. Type the following command: `/usr/libexec/java_home -V | grep -E 'JDK|JRE'` and press Enter. This will display all installed versions of the Java Development Kit (JDK) and Java Runtime Environment (JRE).
🌐
Rbind
justinbagley.rbind.io › 2020 › 01 › 05 › how-to-check-java-version-on-mac
How to check Java version and JDK version on Mac - blog
January 5, 2020 - On my machine, the sanitized version of this procedure looks like: $ java --version openjdk 11.0.1 2018-10-16 LTS OpenJDK Runtime Environment Zulu11.2+3 (build 11.0.1+13-LTS) OpenJDK 64-Bit Server VM Zulu11.2+3 (build 11.0.1+13-LTS, mixed mode) ... Similar to #2 under the “Checking Java version on macOS” section above, this is a command line procedure, which in my example will use Mac Terminal.
🌐
Linux Hint
linuxhint.com › check-java-version-mac
How to Check Java Version on Mac – Linux Hint
The Java Control Panel provides various options and settings. To check the version, go to General tab and then click on About button: A window will open displaying the Java version installed on Mac:
🌐
Coderwall
coderwall.com › p › g7kkba › get-the-list-of-all-jvm-on-your-mac
Get the list of all JVM on your Mac (Example)
December 29, 2022 - OSX comes with an handy cli tool ... current Java installation home path. Just type the following command on your terminal shell: ... It prints the home path of your JVM. Even more interestingly specifying the option -V, it shows the list of all the JVMs installed on your system along their home path. This nice tool has other useful options, like filtering the JVM by version or architecture, ...
🌐
JavaBeat
javabeat.net › home › how to check java version? windows | mac | linux
How to Check Java Version? Windows | Mac | Linux
May 6, 2024 - Important: You can determine the JDK version installed on your macOS by executing the following command: ... To check the Java version using Mac GUI, open the menu bar and navigate to the “System Preferences…”:
🌐
JavaForge
javaforge.com › home › where is java installed on mac
Locate Java Installation on Mac: A Developer's Guide - JavaForge
March 28, 2024 - To identify the precise version of the JDK installed on your system, macOS offers a simple terminal command that provides a comprehensive overview of all installed Java versions, their specific versions, and their exact installation locations.
🌐
Uprightlabs
help.uprightlabs.com › en-us › lister › how-to-check-java-version-in-windows-or-mac
How to Check Java Version in Windows or Mac
This guide covers how to check if Java is installed correctly on your system. If you’re running into issues enabling Lister Connect after following our Troubleshooting Lister Connect Errors guide, this article will guide you through how to check your Java version to see if it needs to be installed or updated.
🌐
Tata Neu
tataneu.com › home › consumer electronics › mac java version checklist: quick steps to verify
Mac Java Version Checklist: Quick Steps to Verify
May 5, 2025 - To determine if the JDK is installed, enter javac -version in your Terminal. This command helps you determine java version mac as it returns the JDK version number. If an error is shown, it may indicate that the check installed java version ...