Many times developers end up installing multiple versions of Java JDK/JRE versions on their macOS, as Java comes in different implementations - Oracle, Amazon Corretto OpenJDK, Zulu, etc are installed at different locations.
In order to know that versions of Java have been installed on a Mac computer running macOS is to run the command: /usr/libexec/java_home -V
Steps to check installed Java versions:
- Open Terminal
- Go to /usr/libexec, by doing cd /usr/libexec
- Type: ./java_home -V
code2care@mac libexec % ./java_home -V
Matching Java Virtual Machines (3):
11.0.9.1 (arm64) "Azul Systems, Inc." - "Zulu 11.43.1021" /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
1.8.291.10 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_292 (arm64) "Azul Systems, Inc." - "Zulu 8.54.0.21" /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home

Get List of installed java Versions on macOS
As you can see I have three versions of Java installed, 11 and 1.8 arm64 bit version Zulu Java for Native M1 Mac computer, and Oracle Java 1.8.
Have Questions? Post them here!
More Posts related to Java,
- How to get Java Thread name Example [Program]
- Java 8: Get First and Last Date of the Week for Given Date
- Convert String to int in Java
- How to Get List of All Country Codes in Java Using Locale Class
- Convert Multidimensional Array toString In Java
- [Fix] java: incompatible types: incompatible parameter types in lambda expression error
- Display Era details (AD BC) in Java Date using SimpleDateFormat
- Create a Zip file using Java Code programmatically
- [Fix] java.net.MalformedURLException: unknown protocol
- [fix] Java JDBC ConnectException: Connection refused
- Read Json File and Convert to Java Object using Jackson
- list of jars required for hibernate 4.x.x
- Simple Struts 2 Tutorial in eclipse with tomcat 7 server
- Java: The value of the local variable string is not used
- [fix] URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs) IntelliJ
- Java 8+ get Day of the Week Examples with LocalDateTime, DateTime, ZonalDateTime and Instant classes
- Run SQL Script file using Java JDBC Code Example
- Remove Trailing zeros BigDecimal Java
- Java JDBC IN Clause Example with PreparedStatement MySQL
- Convert Java List to Json String using Jackson
- Java 8 foreach loop code examples
- error: file not found: HelloWorld.java
- IntelliJ Keyboard Shortcut to remove unused imports [Java]
- Exception in thread main java.lang.NoClassDefFoundError: package javaClass
- Struts 2 Hello World Example in Eclipse
More Posts:
- Python - Convert float to String - Python
- How to activate and use Microsoft Teams Together mode - Microsoft
- Github: How to Invite Collaborators - Git
- [fix] Docker Desktop App not starting on Mac (macOS) - Docker
- How to Fix Spelling Errors on Microsoft Word for Mac - HowTos
- ASCII to HEX and HEX to ASCII Conversion Notepad++ - NotepadPlusPlus
- Error : Facebook SDK AndroidRuntime?FATAL EXCEPTION: main - Android
- zsh: command not found: cls macOS Big Sur - MacOS