Understanding the Java version installed on your system is a fundamental step for many users, particularly those engaged with software development, system administration, or even running specific applications that rely on particular Java Runtime Environments (JREs) or Java Development Kits (JDKs). This knowledge is crucial for ensuring compatibility, troubleshooting issues, and taking advantage of the latest features and security patches. Whether you’re a seasoned developer or a casual user encountering a prompt to update or verify your Java installation, knowing how to definitively check your version is an essential skill. This guide will walk you through the most common and reliable methods for determining your installed Java version across different operating systems.

Checking Java Version via Command Line
The command line interface (CLI) offers the most direct and universally applicable method for checking your Java version, regardless of your operating system. This approach bypasses graphical user interface (GUI) complexities and provides immediate, unambiguous results. It’s the preferred method for developers and system administrators due to its speed and automation potential.
Using the java -version Command
The primary command for querying the Java runtime is java -version. This command will output information about the installed Java Runtime Environment (JRE), including its version number, a build identifier, and the JVM (Java Virtual Machine) details.
For Windows Users:
- Open the Command Prompt: Press the Windows key, type
cmd, and press Enter. Alternatively, you can search for “Command Prompt” in the Start Menu. - Type the Command: In the Command Prompt window, type
java -versionand press Enter. - Interpret the Output: The output will typically look something like this:
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)
In this example, “1.8.0_301” indicates that Java version 8, update 301, is installed. Note that older versions might display as “1.x.x” while newer versions (Java 9 and later) often use a simpler “major version number” format, such as “11.0.12” or “17.0.1”.
For macOS Users:
- Open the Terminal: You can find Terminal in the Utilities folder within Applications, or by searching for “Terminal” using Spotlight (Command + Space).
- Type the Command: In the Terminal window, type
java -versionand press Enter. - Interpret the Output: The output will be similar to the Windows example, clearly displaying the installed Java version.
For Linux Users:
- Open the Terminal: Most Linux distributions provide a Terminal application accessible from the applications menu or via keyboard shortcuts (often Ctrl+Alt+T).
- Type the Command: In the Terminal window, type
java -versionand press Enter. - Interpret the Output: The output format will be consistent, allowing you to identify the installed Java version.
Important Considerations for java -version:
- Multiple Java Installations: If you have multiple versions of Java installed, the
java -versioncommand will typically report the version that is currently active in your system’s PATH environment variable. To manage or check specific installations, you might need to adjust your PATH or use more advanced methods. - JRE vs. JDK: The
java -versioncommand reports the Java Runtime Environment (JRE) version. If you are a developer and need to check your Java Development Kit (JDK) version, you can use a similar command.
Using the javac -version Command (for JDK)
If you are a developer and have installed the Java Development Kit (JDK), you can check its version using the javac -version command. javac is the Java compiler, and its presence indicates a JDK installation.
- Open your preferred command-line interface (Command Prompt on Windows, Terminal on macOS/Linux).
- Type the Command: Enter
javac -versionand press Enter. - Interpret the Output: The output will be much simpler, usually just displaying the version number. For example:
javac 11.0.12
This output signifies that the JDK version 11.0.12 is installed. If thejavaccommand is not recognized, it means either the JDK is not installed, or itsbindirectory is not included in your system’s PATH environment variable.
Checking Java Version via Graphical User Interface (GUI)
For users who prefer not to use the command line, most operating systems provide a graphical way to check installed Java versions, particularly through the Java Control Panel.
Java Control Panel on Windows
The Java Control Panel is a dedicated utility for managing Java settings and verifying installations on Windows.
- Access the Java Control Panel:
- Press the Windows key and type “Configure Java” or “Java Control Panel.”
- Alternatively, open the Control Panel (search for “Control Panel” in the Start Menu), and then look for “Java” under the “Programs” category.
- Navigate to the “About” Section: Once the Java Control Panel opens, click on the “About” button, which is usually located in the bottom right corner of the “General” tab.
- View Version Information: A dialog box will appear, displaying the details of your installed Java Runtime Environment, including the version number. It will also usually have a checkbox to “Show this page when Java starts,” which can be unchecked if you don’t want it to appear every time Java is initialized.
- Updates: This section also typically indicates if updates are available for your installed Java version.
Java Control Panel on macOS
While macOS has undergone significant changes regarding Java bundling over the years, it previously had a similar Java Control Panel accessible through System Preferences. For modern macOS versions, it’s more common to rely on the command line, as Java is often managed through third-party installations or specific application requirements. However, if a system-level Java installation exists and was managed through older methods:
- Open System Preferences: Click the Apple menu in the top-left corner and select “System Preferences.”
- Locate the Java Icon: Look for a “Java” icon. If it’s not present, a system-level Java installation may not be managed this way.
- Access “About Java”: Within the Java Preferences window, navigate to the “About” section (similar to the Windows version).
- View Version Information: The version details will be displayed here.
Checking Within Applications
Some applications that require Java might provide their own way to check the Java version they are using. This is often found in:
- “About” or “Help” Menus: Look for options like “About [Application Name]” or “System Information” within the application’s menus.
- Configuration or Settings Panels: Some applications have specific settings panels where Java runtime details might be listed.
![]()
This method is less universal but can be useful if you’re troubleshooting a specific application that’s failing due to an incorrect or missing Java version.
Understanding Java Versioning Schemes
Java versioning can sometimes be a point of confusion, especially with the shift from the traditional “1.x.x” numbering to a faster release cadence.
Traditional Versioning (Java 8 and Earlier)
For many years, Java versions followed a “1.x.x” format. For example:
- Java 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8.
- It’s important to note that “Java 1.5” was rebranded as “Java 5,” “Java 1.6” as “Java 6,” and so on, up to “Java 1.8” which is commonly referred to as “Java 8.” The underlying release number (e.g., 1.8.0) is still technically accurate, but the public-facing name became the major version number.
Modern Versioning (Java 9 and Later)
Starting with Java 9, Oracle and other vendors adopted a faster, six-month release cycle. This significantly changed the versioning scheme:
- Java 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, and so on.
- The version number now directly reflects the major release number. For example, if you see “Java 17,” it refers to the seventeenth major release of Java.
- Long-Term Support (LTS) Releases: Oracle designates certain releases as Long-Term Support (LTS). These versions receive updates and support for a longer period, making them ideal for enterprise deployments. Examples include Java 8, 11, 17, and 21. Other releases are feature releases and have shorter support cycles.
When checking your Java version, pay attention to whether the output shows a “1.x.x” format or a simpler major version number to understand which scheme you’re dealing with.
Why Knowing Your Java Version Matters
The necessity of knowing your Java version stems from several critical factors, impacting software execution, security, and development efficiency.
Application Compatibility
Many applications are developed and tested against specific Java versions. Running an application with an incompatible Java version can lead to:
- Runtime Errors: The application might fail to launch or crash unexpectedly due to missing features or changes in the Java API.
- Performance Issues: Older applications might not perform optimally on newer Java versions due to deprecations or optimizations in later releases, and conversely, newer applications might not run at all on older JREs.
- Security Vulnerabilities: Some applications may rely on specific security features or implementations present only in certain Java versions.
Development and Deployment
For developers, maintaining awareness of their JDK version is paramount:
- Feature Utilization: Developers need to know their JDK version to leverage new language features, APIs, and performance improvements introduced in newer releases.
- Dependency Management: Libraries and frameworks often have minimum Java version requirements. Understanding your installed JDK ensures you can use the intended dependencies.
- Build and Deployment: When building and deploying applications, specifying the target Java version is crucial for ensuring that the application runs correctly in the target environment. This also applies to containerized applications (e.g., Docker images) where the base Java image version must be carefully selected.
Security Updates and Patches
Oracle and other Java vendors regularly release updates that address critical security vulnerabilities and bugs. Running an outdated Java version leaves your system susceptible to known exploits. Regularly checking your Java version and applying updates is a fundamental aspect of maintaining a secure computing environment. This is especially true for applications that expose Java components to external networks.
Troubleshooting Common Issues
Occasionally, you might encounter problems when trying to check your Java version or when Java isn’t behaving as expected.
“Java is not recognized as an internal or external command”
This error message, commonly seen on Windows, or similar “command not found” errors on macOS and Linux, typically means that the Java executables (java.exe or javac.exe) are not in your system’s PATH environment variable.
- Solution: You need to add the
bindirectory of your Java installation to your PATH. The exact steps vary by operating system.- Windows: Search for “environment variables,” click “Edit the system environment variables,” then click “Environment Variables.” Under “System variables,” find “Path,” click “Edit,” and add the path to your Java
bindirectory (e.g.,C:Program FilesJavajdk-11.0.12bin). - macOS/Linux: Edit your shell’s configuration file (e.g.,
.bashrc,.zshrc,.profilein your home directory) and add a line likeexport PATH="/path/to/your/java/bin:$PATH". After saving, either restart your terminal or runsource ~/.bashrc(or your respective config file).
- Windows: Search for “environment variables,” click “Edit the system environment variables,” then click “Environment Variables.” Under “System variables,” find “Path,” click “Edit,” and add the path to your Java

Multiple Java Versions Conflicting
If you have multiple Java versions installed, the one that is higher in your system’s PATH will be the one that gets executed. This can cause issues if an application specifically requires an older or different version.
- Solution: You can:
- Manually Set PATH: Temporarily modify your PATH for a specific command execution or script to point to the desired Java installation’s
bindirectory. - Use Version Managers: Tools like SDKMAN! (for Linux/macOS), or similar solutions for Windows, allow you to easily install, switch between, and manage multiple Java versions.
- Update System Defaults: For Windows, you can use the Java Control Panel to set the default Java version. On Linux/macOS,
update-alternativesor symbolic links can manage default commands.
- Manually Set PATH: Temporarily modify your PATH for a specific command execution or script to point to the desired Java installation’s
By mastering these methods for checking your Java version and understanding the underlying reasons, you are better equipped to manage your software environment, ensure compatibility, and maintain robust security practices.
