How to Check Your Java Version on Mac

Find the answer to “check java version mac” with Terminal commands for your active runtime, installed releases, compiler, and apps.

Contents

Don't Miss the Good Stuff

Get tech news that matters delivered to your inbox.

To check your Java version on a Mac, open Terminal, type java -version, and press Return. The output identifies the Java selected in that Terminal session, including its runtime and build information. If you need to check another installation or an app's runtime, use the matching check below.

The short version

  • Start in Terminal: Run java -version to check the Java selected in your current session.
  • Find other installations: Run /usr/libexec/java_home -V to list Java installations recognized by macOS.
  • Check the right runtime: Your project or app can use a different Java installation from Terminal.
  • Use existing tools: You do not need to download Java merely to check an existing installation.

Method or placeWhat you can checkWhen to use it
Terminal version commandSelected Java runtime and buildStart here
Additional Java flagsVersion, properties and JVM build detailsYou need more runtime information
macOS installation listRecognized versions, architectures, vendors and pathsYou need to find other installations
Specific release checkVersion selected for a requested releaseSeveral releases are installed
Full executable pathVersion of that exact executableYou know the installation location
Compiler version commandSelected Java compiler versionYou use a JDK
Finder installation folderStandard installation bundle namesYou want to inspect installed folders
HomebrewInstalled Java package versionsHomebrew already manages your Java
SDKMAN!Managed installed and selected versionsSDKMAN! is already initialized
jEnvRegistered versions and current selectionjEnv is already configured
IntelliJ IDEA project settingsConfigured project or module SDKYou need a project's Java version
IntelliJ IDEA runtime chooserThe IDE's own runtimeYou need the Java powering the IDE
Running JVM diagnosticsAn attachable Java process's versionMatching JDK tools are available
Oracle Java 8 JRE executableThe separately installed JRE versionYou have that Oracle Java 8 installation
Oracle Java DownloadsAvailable macOS downloadsYou separately need an installation

Check your Java version in Terminal

Open Finder > Applications > Utilities > Terminal. Type the following command, then press Return.

java -version

Read the version and runtime or build information printed below the command. This identifies the Java selected by your current Terminal session. If that is the installation you wanted to check, you can stop here.

If the command fails to return a version, try the installation list below or check a known Java executable by its full path. Those checks let you inspect recognized installations or a runnable installation outside the shell's search path.

List the Java installations recognized by macOS

Enter the following command in Terminal and press Return. Read each entry's version, CPU architecture, vendor and installation path.

/usr/libexec/java_home -V

Use the entries to identify the installation you want to inspect next. The list covers installations registered for discovery by java_home, including registered Azul Zulu JDKs and JREs. It is not a guaranteed inventory of private app runtimes or manually unpacked installations.

If the JAVA_VERSION environment variable is set, it can filter the results. Run the following command and press Return to remove that filter for this command only.

(unset JAVA_VERSION; /usr/libexec/java_home -V)

Check a particular Java installation

Once you identify an installed major release, request its version directly. For an installed Java 21 release, enter the following command and press Return.

/usr/libexec/java_home -v 21 --exec java -version

Replace 21 with the installed release you want to check; for Java 8, use 1.8. Read the returned version to confirm which installation was selected. This method applies to installations recognized by java_home.

To check an exact executable, use its full path. Replace the example path below with the actual location, keep the quotation marks, and press Return.

"/full/path/to/Contents/Home/bin/java" -version

This works for accessible, runnable installations outside the shell's search path, too. For an app-bundled runtime, you need the app's actual runtime location and an included Java executable.

For Oracle JDK 27 installed in its standard location, you can use the following path directly. Run the command and press Return to check that installation.

/Library/Java/JavaVirtualMachines/jdk-27.jdk/Contents/Home/bin/java -version

Oracle's separately installed Java 8 JRE has a different executable location. If you have that JRE installed at the location below, run this command and press Return to check it, even when java -version selects another JDK.

/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

Inspect Java folders in Finder

In Finder, press Shift + Command + G to open Go to Folder. Enter the following path, then press Return.

/Library/Java/JavaVirtualMachines/

Inspect the bundle names in this standard system directory. They help identify installed release families, but may omit patch versions and do not identify the active runtime. Use the installation's executable with -version to establish its exact build.

If you prefer Terminal, you can list the same directory's entries there. Run the following command and press Return.

ls -1 /Library/Java/JavaVirtualMachines/

Check Java managed by an existing tool

If Homebrew already manages Java on your Mac, use its package records to inspect installed versions. Run the following command, press Return, and look for Java-related formula entries.

brew list --versions

For a known formula, narrow the result to its name. Run the following command and press Return, replacing openjdk if your formula has a different name.

brew list --versions openjdk

To inspect package details for that formula, use the next command. Press Return, then distinguish the installed package information from the currently available upstream version.

brew info openjdk

For an installed Temurin cask, use the following command and press Return. Homebrew's package records do not establish which runtime your shell or an app currently uses.

brew info --cask temurin

If SDKMAN! is already installed and initialized in your Terminal session, check its selected Java version with the following command. Press Return to display the selection.

sdk current java

To inspect SDKMAN!'s available, installed and currently selected versions together, run the next command and press Return. Use the displayed markers to distinguish those categories.

sdk list java

For an existing jEnv setup, enter the following command and press Return. Read the registered versions and the entry marked with an asterisk.

jenv versions

A project-local jEnv selection can differ from the global selection. Run the following command in the same directory and press Return to confirm the runtime actually selected there.

java -version

Check the Java version used by IntelliJ IDEA

In IntelliJ IDEA 2026.3, open File > Project Structure > Project Settings > Project and inspect SDK. To inspect configured installations, open File > Project Structure > Platform Settings > SDKs.

A module can have its own selection. Within Project Structure, open Project Settings > Modules, select the module, then open Dependencies and inspect Module SDK. These configured JDKs can differ from your Terminal selection.

JetBrains says the IDE normally uses its bundled JetBrains Runtime, which is separate from your project SDK. To inspect it, open Help > Find Action…, find and select Choose Boot Java Runtime for the IDE…, then read the runtime information in the dialog. Close the dialog without applying a change.

Get compiler and runtime details when needed

On Java 9 and later, you can use the following alternative version command. Run it and press Return to print version information to standard output.

java --version

If you have a JDK with its compiler executable available, check the selected compiler with the next command. Press Return and read the compiler version, which can differ from the runtime selected by java.

javac -version

Current JDKs also accept the following compiler version flag. Run it and press Return if you prefer this form.

javac --version

For more runtime details with Oracle JDK 27, the following command includes system properties such as the runtime version and installation location. Run it and press Return; availability of these diagnostic options can vary with other JVM implementations.

java -XshowSettings:properties -version

With Oracle JDK 27, you can also request more detailed JVM build information. Enter the following command and press Return.

java -Xinternalversion

To inspect a running Java application's JVM, you need suitable JDK diagnostic tools matching the target JDK version and an attachable process. Run the tools under the same effective user and group as that process. Start with the following command and press Return to list discoverable Java processes.

jcmd -l

Note the target process ID from the list. Replace 12345 below with that ID, then press Return to request its JVM version.

jcmd 12345 VM.version

If you also need that process's runtime properties, use the next command with the same process ID. Press Return to display the properties.

jcmd 12345 VM.system_properties

Replace outdated checks with executable checks

If older instructions send you to Java Preferences, use the Terminal version check instead; Oracle identifies that application as retired. The Java Control Panel and Java Console belong to older Java deployment environments. Applet-based version detection is also obsolete in current Chrome and Firefox, so check the executable directly.

If you separately need an installation, open Oracle Java Downloads and inspect the desired release's macOS options. Choose from the options for supported macOS and processor combinations. No download is required merely to check an existing installation.

Frequently Asked Questions

Why might you have Java but no Java compiler?

A standalone JRE does not include the javac compiler. You need a JDK with its compiler executable available to check the compiler version.

Does every entry in jEnv mean a separate Java installation?

No, multiple jEnv aliases can represent one installation. You cannot determine the number of separate installations from the number of registered entries alone.

Can the old Java Control Panel show all your JDKs?

No, the Oracle Java 8 Control Panel runtime table on macOS displays the currently installed JRE and excludes JDKs. The Control Panel was removed from JDK 11 onward.

Does the Oracle Java Downloads page detect your installed version?

No, it identifies available downloads. It does not detect the Java version installed on your Mac.

Share