| by Arround The Web | No comments

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:

1: Through GUI

2: Through Terminal

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:

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

 

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:

java -version

 

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.

Share Button

Source: linuxhint.com

Leave a Reply