- Java current version check
- How to switch Java version
- Java version history
- JDK 14: New hot Features
- How to Check Java Version
- About Java
- Versions of Java
- 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 Determine Java Version
- Verifying Online
- Windows
- Mac OSX
- Linux
- Expert Q&A
- You Might Also Like
- How to check Java version
- Related Topics:
- About the Author:
Java current version check
You can find the Java installation path on Ubuntu using following command:
It will give path of Java installation directory, if you have multiple versions installed, then only the default Java version (set in your system) wll be displayed.
You can find the Java installation path on Ubuntu using following command:
It will give you Java installation path
How to switch Java version
You can have multiple installed versions of JDK on one machine. At any time, You can decide which Java version you want to make default version and should be used from command line automatically. The update-alternatives command is very helpful in switching between JDk versions, it will list all the installed Java versions. From that list, you can select which is the default version, you can want to keep.
sudo update-alternatives --config java
All available Java versions will be listed as shown below, with a sequence number. You can select any Java version using these sequence numbers. An Asterisk (*) mark shows that this Java version is currently being used as default version.
There are n choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode * 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode 3 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode Press to keep current choice[*], or type selection number:
Java version history
The Java language has undergone several changes since JDK 1.0 also as numerous additions of classes and packages to the core library. The evolution of Java language has been governed by the JCP (Java Community Process), which uses JSRs (Java Specification Requests) to specify changes and propose changes, for additions to the Java.
In addition to the language semantics, lots of other changes have been made to the Class Libraries over the years, which has now grown from a couple of hundred classes to over three thousand. Entire new APIs, like Swing and Java2D, are introduced, and lots of of the first JDK 1.0 classes and methods are deprecated.
JDK 14: New hot Features
May 16, 2020
How to Check Java Version
In today’s blog, we will be showing you how to check the Java version on Windows and macOS operating systems.
List of content you will read in this article:
Among all the programming languages, Java is considered to be the most commonly used language that has been adopted worldwide. There are numerous reasons why Java has gained popularity over other alternatives. There is no doubt that Java has been famous among all Fortune 500 companies and is widely recommended by developers. Its user-friendly and flexible nature makes it a go-to programming language for web developers and programmers.
The main reasons behind Java being popular is its fast speed, high-end security, and reliability. Along with such benefits, Java also offers private transmission, automatic memory management, and secure crucial information.
About Java
Introduced in the 1990s by James Gosling, Java is an object-oriented, robust, and secure programming language. The team started this Java project to develop a language suitable, especially for digital devices like set-top boxes, television, etc. At first, C++ was to be used in the Java project but was not considered for some reasons. Later, Gosling expanded C++ and led to another stage of a project Green, which was later renamed the ‘Greentalk’ project by Gosling and his team members. These project files had the file extension as .gt, which is later recognized as ‘OAK.’
The name ‘OAK’ was given to the project after an oak tree that was located outside Gosling’s office. But later on, the term ‘OAK’ was changed to Java. After various talks and brainstorming sessions, Gosling and his team come to multiple names- JAVA, DNA, SILK, BURY, etc. Still, they decided on JAVA after many discussions due to its uniqueness. This name (Java) comes up from a type of espresso bean. Gosling and his team members had come up with this name while having a cup of coffee near their office.
The main principles on which Java was built are- robust, portable, platform-independent, multi-thread, etc. In 1995, Java was recognized as one of the ten best products in Time magazine. Today, Java has been used in various fields like internet programming, mobile devices, games, etc. later, multiple versions of Java have been introduced over the years with new added features and functionalities.
Versions of Java
Over time, Java has introduced various versions with different and advanced features than the earlier version. Every version has fulfilled the drawback of their previous versions. Some of the versions are still supported, and some of them are not. Below is the list of all the Java versions introduced to date.
Support Until
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 Determine Java Version
This article was co-authored by Yaffet Meshesha. Yaffet Meshesha is a Computer Specialist and the Founder of Techy, a full-service computer pickup, repair, and delivery service. With over eight years of experience, Yaffet specializes in computer repairs and technical support. Techy has been featured on TechCrunch and Time.
This article has been viewed 392,752 times.
Multiple copies of Java can be installed on a single computer, and, if you have more than one browser, every one of them could be using a different version or none at all. You can determine your Java version by verifying it on the Java website, or you could check using the Windows command prompt, Mac terminal, or Linux terminal.
Verifying Online
Open a new window in your web navigate to Java’s website. Oracle, the makers of Java, have provided an easy page that will check your Java installation and report the exact version you’re running. This can be done from any operating system.
After a few seconds, check the results! This will include the Version number as well as the Update number. The version number is most important if you’re checking for compatibility with other programs.
Windows
Wait for a black window with white text to appear on your screen. This is called a «console window.»
- You can tell what version of Java you have by looking at the number after the «1.» in the first line of the console output. In this example, the user has Java 8 installed.
Mac OSX
With Utilities open, open the Terminal and type in «java -version», then retrieve the current java version.
Linux
- This should return something like Java(TM) 2 Runtime Environment, Standard Edition (build 1.6) If it returns
-bash: java: command not found
This means that either it is not installed or you haven’t set up your paths properly
- With Firefox 3 go to Tools Add-ons button and go to the Plug-ins tab.
- With Firefox 2 or 3: In Firefox versions 2 and 3, enter in the address bar: about:plugins. If Java is installed there will be multiple Java entries.
- With Internet Explorer 7 or 8 go to Tools select Internet Options in the General tab click on the Browsing History Settings button and select the View Objects button right click on an ActiveX control and get its properties. Each ActiveX control has a «code base» and for each of the Java entries it will display the version number.
Expert Q&A
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
How to check Java version
This article describes some ways which you can use to check version of Java on your Windows computer. More exactly, the version of Java Runtime Environment (JRE) or Java Development Kit (JDK).
If you have OracleJDK installed on your computer, simply click menu Start, type about java into the search area, then click the About Java icon in the result. You can see the current version of Java in the following dialog:
Or you can go to Control Panel, switch to Large icons view and click the Java logo:
Then in the Java Control Panel dialog, click About button as shown in the following screenshot:
The second way (more familiar with programmers) to check Java version is opening a command prompt and type the following command:
Here, the version of Java is 1.8.0, and 201 is the update number. Each version can have several update numbers — the higher the more recent it is.
Note that “Java(TM) SE Runtime Environment” meaning that you’re using Oracle JDK. In case you’re using OpenJDK, the output should be:
If JDK/JRE is not installed or somehow the PATH environment variable is not updated for Java, you can see the following message:
Note that there can be multiple installations of JRE and/or JDK on a computer. In that case, the version of Java you see in the console is of the first JRE/JDK found in the list of environment variables.
To check the version exactly, you need to go to the bin directory of a JDK/JRE installation, for example:
cd C:\Program Files\Java\jdk1.8.0_201\bin
Related Topics:
About the Author:
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.