[JAVA] Check the version of the JDK installed and the version of the JDK enabled

1. Check the installed JDK version

Execute the following command.

/usr/libexec/java_home -V

Execution result

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    12.0.1, x86_64:	"AdoptOpenJDK 12"	/Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk/Contents/Home
    11.0.3, x86_64:	"AdoptOpenJDK 11"	/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
    1.8.0_212, x86_64:	"AdoptOpenJDK 8"	/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home

2. Check the version of JDK that is enabled

Execute the following command.

java -version

Execution result

$ java -version
openjdk version "12.0.1" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.1+12)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.1+12, mixed mode, sharing)

Recommended Posts

Check the version of the JDK installed and the version of the JDK enabled
[Java] Check the JDK version of the built war file
Check the version of Cent OS
This and that of the JDK
Check the version of the standard Web software.
[CentOS] Download and build the specified version of Git
Switch the version of bundler
Gemfile.lock doesn't say the version of gem you have installed
Command to check the number and status of Java threads
How to check the extension and size of uploaded files
[Rails] Check the contents of the object
[Java version] The story of serialization
Check the migration status of rails
Switch the version of java installed by SDKMAN when moving directories
About the version of Docker's Node.js image
Check the contents of the Java certificate store
Check the contents of params with pry
Memo: [Java] Check the contents of the directory
[Rails] Check the instance variables and local variables of the file you are browsing
Folding and unfolding the contents of the Recyclerview
About the operation of next () and nextLine ()
About the mechanism of the Web and HTTP
[Java] Check the number of occurrences of characters
Check the operation of the interface through threads
How to check the latest version of io.spring.platform to describe in pom.xml of Spring (STS)
Think about the combination of Servlet and Ajax
[Docker] Check the running container and enter there
Compare the speed of the for statement and the extended for statement.
[Java] Access the signed URL of s3 (signed version 2)
[Java] The confusing part of String and StringBuilder
I compared the characteristics of Java and .NET
Manage the version of Ruby itself with rbenv
Let's check the feel of Spring Boot + Swagger 2.0
Try the free version of Progate [Java II]
Learn the rudimentary mechanism and usage of Gradle 4.4
About next () and nextLine () of the Scanner class
Install the latest version of Jenkins on Ubuntu 16
What are the advantages of DI and Thymeleaf?
Try the free version of Progate [Java I]
Java version check
[Final version] Check the operation of the Japanese calendar using ICU to support the new era.
Is there a performance difference between Oracle JDK and OpenJDK at the end of 2017?
Library not loaded when trying to upgrade the version of ruby and rails s
Check the behavior of getOne, findById, and query methods in Spring Boot + Spring Data JPA
ArrayList and the role of the interface seen from List
Existence check of has_many and belongs_to-optional: What is true?
Please note the division (division) of java kotlin Int and Int
[For beginners] DI ~ The basics of DI and DI in Spring ~
Check the capacity of the Linux server. (Df command, du command)
The comparison of enums is ==, and equals is good [Java]
[Grails] About the setting area and the setting items of application.yml
Convert the array of errors.full_messages to characters and output
Organizing the current state of Java and considering the future
Java language from the perspective of Kotlin and C #
Check the behavior of Java Intrinsic Locks with bpftrace
Until the use of Spring Data and JPA Part 2
Verification of the relationship between Docker images and containers
Until the use of Spring Data and JPA Part 1
I summarized the types and basics of Java exceptions
[Technical memo] About the advantages and disadvantages of Ruby
Check the result of generic parameter inference with JShell