- How to check Java version and JDK version on Mac
- Checking Java version on macOS
- Checking JDK version on macOS
- How to Check Java Version on a Mac
- Checking Your System Preferences
- Reviewing the Java Website
- Getting Information from Your Terminal
- Expert Q&A
- Tips
- You Might Also Like
- About This Article
- Is this article up to date?
- Quizzes
- You Might Also Like
- How to Check Java Version on Mac or Windows
- Check Java Version on Mac
- Option 1: Check Java Version on Mac Using the GUI
- Option 2: Check Java Version on Mac Using the Terminal
- Check Java Version on Windows
- Option 1: Check Java Version on Windows Using GUI
- Option 2: Check Java Version on Windows Using Command Line
- How to Check Java Version on Mac
- How to Check Java Version on Mac
- How to Check Java Version through GUI on Mac
- How to Check Java Version on Mac through Terminal
- How to Check JDK Version on Mac
- What is the difference between Java and JDK on Mac
- Conclusion
- About the author
- Sam U
How to check Java version and JDK version on Mac
Java is a class-based, object-oriented programming language that is fast and powerful and runs many important computing programs and platforms. When you are about to download new software on Mac, developers may have generated multiple app containers ( .dmg files) that install the software program in different ways depending on the operating system (macOS) and Java versions on your machine. In these situations, and others, it is very important to be able to quickly find out your Java and JDK versions on Mac.
In recent versions of Java for macOS, the default install location for some files has changed and the places to look to determine your Java version, or Java JDK (“Java Development Kit”; technically, now Java SE Development Kit, which stands for “Java Platform, Standard Edition Development Kit”; downloads here) version, have also changed accordingly.
There are two ways that I recommend checking your Java version, and there is one procedure that I like to use to check which JDK is currently in use on my MacBook Pro.
Checking Java version on macOS
1. System Preferences
This one is the easiest option for most users that like using the traditional, visual approach to computing on macOS. Simply open System Preferences (“Apple > System Preferences”), and then click “Java” (you will see the Java icon). The Java preferences open in a separate window, called “Java Control Panel.” In Java Control Panel, do either
The version that is presented in the Java Control Panel is the currently running (=usually recommended) version of Java on your Mac machine.
2. Command line (Terminal) procedure
This is the method preferred by most users who are more familiar with personal computing and the command line interface. Simply open a shell interpreter (command line interface) such as the Terminal application, and type
The Java executable on your local machine will output the appropriate Java versioning information. And voilà, you’re done!
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)
Checking JDK version on macOS
1. Command line (Terminal) procedures
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. Here, it’s important to know that on recent versions of Java, the JDK is located at absolute path /Library/Java/JavaVirtualMachines/ . Armed with this information, we can simply open Terminal and list the contents of this directory on our machine to find the JDK version, as follows:
ls /Library/Java/JavaVirtualMachines
The only potential issue here would be if you had multiple JDK versions installed. In that case, I recommend that users check their $JAVA_HOME bash environmental variable from within Terminal to make a JDK determination, as follows:
$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
This, output on my machine, tells me that I am using JDK version 1.8.0_101. Done!
I hope this helps someone who quickly needs to find information on Mac about their Java install before making other software install or updating decisions!
Copyright © 2018 Justin C. Bagley
How to Check Java Version on a Mac
This article was co-authored by wikiHow staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for wikiHow. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College.
The wikiHow Tech Team also followed the article’s instructions and verified that they work.
This article has been viewed 132,464 times.
This wikiHow will teach you how to check what version of Java you have installed on your Mac by checking the System Preferences, using the Java website, or by using your Mac’s Terminal.
Checking Your System Preferences
- If there is an update available, follow the instructions to update to the latest recommended version of Java. You can also check the box for «Check for Automatic Updates» so your version will always be updated to the latest versions when they are available.
Reviewing the Java Website
Go to java.com/en/download/installed.jsp in Safari. Type java.com/en/download/installed.jsp in the address bar and press ⏎ Return .
Click Verify Java Version . It’s a red button in the center of the page. This may prompt a pop-up window asking if you want to run Java on this page.
Click Run , to confirm. The website will detect what version of Java you are running and recommend an update if needed.
Getting Information from Your Terminal
. It’s the icon of a small black box with a white command prompt in the corner. This will open your Mac’s Terminal.
Type java -version and press ⏎ Return . This command will tell you what version of Java your Mac is currently running.
Expert Q&A
Tips
You Might Also Like
How to Set JAVA_HOME for JDK & JRE: A Step-by-Step Guide
Use Easy Windows CMD Commands to Check Your Java Version
How to Do Division in Java (Integer and Floating Point)
How to Compile and Run Java Programs Using Notepad++
Simple Steps to Type a Bunny with Your Keyboard
About This Article
This article was co-authored by wikiHow staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for wikiHow. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College. This article has been viewed 132,464 times.
Is this article up to date?
Quizzes
You Might Also Like
How to Set JAVA_HOME for JDK & JRE: A Step-by-Step Guide
Use Easy Windows CMD Commands to Check Your Java Version
How to Do Division in Java (Integer and Floating Point)
How to Check Java Version on Mac or Windows
Java runs many of the applications that we use daily. Many applications cannot run on older versions of Java. Hence, it is essential to know which version is installed on your system.
In this tutorial, learn how to check the Java version on your Mac or Windows system.
- A system running macOS or Windows
- Access to the command-line/terminal window
- A version of Java installed
Check Java Version on Mac
You can find the version of Java on macOS by:
- using the GUI (Mac’s System Preferences)
- prompting for the version in the terminal window
Option 1: Check Java Version on Mac Using the GUI
To check the Java version on Mac without using the terminal by searching for the Java Control Panel in the System Preferences.
1. Click the Apple icon in the menu bar to open the drop-down menu and navigate to System Preferences.
2. A new window opens with various icons and settings. Find and click the Java icon to open the Java Control Panel.
3. Once the Java Control Panel opens, click the About button. A new window with Java version information should appear.
Option 2: Check Java Version on Mac Using the Terminal
If you prefer using the terminal, checking the Java version is a simple one-command process.
1. First, open the terminal. To do so, click the Spotlight Search button in the top-right of the screen.
2. 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.
To check the version of the primary Java compiler – javac (pronounced “java-see”) use the command:
Note: If you have a Linux system, refer to How To Check Java Version Installed On Linux.
Check Java Version on Windows
To check the Java version on a Windows computer, you can use:
Option 1: Check Java Version on Windows Using GUI
To find the Java version on your Windows without opening a terminal window, use the Control Panel.
1. Open the Windows menu in the bottom-left corner and type control panel in the search bar.
2. Find the Control Panel in the search results and click the icon to open it.
3. Move to the Programs directory.
4. Find and click the Java icon to open the Java Control Panel.
5. Once the control panel opens, click the About button.
6. The About Java window should appear and display the Java version on your computer.
Option 2: Check Java Version on Windows Using Command Line
Another option to find the Java version on Windows is through the command line.
1. Open the Windows Start menu in the bottom-left corner and type cmd in the search bar.
2. Then, open the Command Prompt once it appears in the search results.
3. A new window with the command prompt should appear. In it, type the command java -version and hit Enter. The output should display the Java version installed on your Windows system.
You can also check the version of the Java’s primary compiler, javac, with the command:
This article showed you how to check the version of Java installed on a macOS or Windows system.
How to Check Java Version on Mac
Java is a widely used programming language to create platform independent applications. There are so many apps that require Java to function properly on a system. Java updates regularly and latest versions of Java make many Java-based apps outdated and some applications even require a specific version of Java to run. To ensure all the apps run without any issue, it is essential to know the installed Java version on Mac. This article is a step-by-step guide to check the version of Java on Mac, let’s begin:
How to Check Java Version on Mac
There are two methods to check Java version on macOS based system:
How to Check Java Version through GUI on Mac
To check Java version on a Mac via graphical user interface follow the steps mentioned below:
Step 1: Open System Preferences
Select System Preferences from the menu after clicking the Apple icon:
Step 2: Access Java Control Panel
If Java Runtime Environment (JRE) is installed on Mac then you will find Java icon in the System Preferences:
An icon of Java can be seen at the bottom row, clicking it will open the Java Control Panel:
Step 3: Check Java Version
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:
As it can be seen in the above image, Java 8 Update 351 and Build 1.8.0_351 is installed on the Mac. Java can also be updated from the Control Panel from the Update tab.
How to Check Java Version on Mac through Terminal
The Java version can also be checked through Mac’s terminal app, follow the steps given below to check Java version via terminal:
Step 1: Open Terminal
To open macOS terminal press Command + Space Bar, type terminal and then open the Terminal app:
Terminal window will open:
Step 2: Check Java Version through Command
To check the Java version on Mac, run the command mentioned below:
Output shows Java version 1.8.0_351 is installed on the Mac.
How to Check JDK Version on Mac
To check the JDK (Java Development Kit) version on Mac use the command mentioned below:
Note: The above output came after installing the JDK.
If you have only Java (JRE – Java Runtime Environment) installed then its version cannot be accessed through the terminal using the command given above. While checking Java version through CLI you may encounter the following error:
To use the Java command line tool, JDK needs to be installed.
What is the difference between Java and JDK on Mac
Java is the run time environment also known as JRE and can only be used to run Java based applications whereas JDK is Java Development Kit used to develop and run Java applications.
Conclusion
Many applications on Mac require Java to function properly. Some applications even require a specific version of Java to function. To find the Java version on macOS based systems, you need to access the Java Control Panel which appears in the last row of the System Preferences after installing the Java Runtime Environment; Java version can also be checked through the terminal.
About the author
Sam U
I am a professional graphics designer with over 6 years of experience. Currently doing research in virtual reality, augmented reality and mixed reality.
I hardly watch movies but love to read tech related books and articles.