How to check Java installed on Mac

I have a terrible memory, so make a note of it.

--Environment: macOS Sierra Version 10.12.4

Check the Java you are currently using

$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

① View all installed Java

$ /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home -V
Matching Java Virtual Machines (5):
    1.8.0_131, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
    1.8.0_45, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
    1.7.0_67, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
    1.6.0_65-b14-468, x86_64:	"Java SE 6"	/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    1.6.0_65-b14-468, i386:	"Java SE 6"	/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home

Reference: Switching Java version on OSX --Qiita

② See all installed Java

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (5):
    1.8.0_131, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
    1.8.0_45, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
    1.7.0_67, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
    1.6.0_65-b14-468, x86_64:	"Java SE 6"	/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    1.6.0_65-b14-468, i386:	"Java SE 6"	/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home

Reference: Install java8 on mac --Qiita

How to switch Java

How to switch Java version on Mac-Qiita

Install Java

-How to install java6 with Homebrew --Qiita

Recommended Posts

How to check Java installed on Mac
How to switch Java versions on Mac
How to uninstall Java 8 (Mac)
As of April 2018 How to get Java 8 on Mac
[Java] How to update Java on Windows
How to switch Java in the OpenJDK era on Mac
How to install Eclipse (Photon) on Mac
How to uninstall if you have updated to Java 9 on your Mac
How to switch Java version with direnv in terminal on Mac
Install Java on Mac
[Java] Memo on how to write the source
[Java] How to use Map
[AWS] How to check logs
How to lower java version
[Java] How to use Map
Java --How to make JTable
How to use java Optional
How to use java non-standard library on IntelliJ IDEA
How to deploy on heroku
How to minimize Java images
How to write java comments
How to use java class
[Java] How to use Optional ②
[Java] How to use removeAll ()
[Java] How to display Wingdings
[Java] How to use string.format
How to use Java Map
[Java] How to execute tasks on a regular basis
How to set Java constants
How to run Java EE Tutial on github on Eclipse
How to use Java variables
How to check JSF version
How to convert Java radix
[Java] How to implement multithreading
[Java] How to use Optional ①
How to install JDK8-10 (Mac)
How to initialize Java array
Notes on how to use regular expressions in Java
How to decompile apk file to java source code with MAC
How to deploy a simple Java Servlet app on Heroku
Memo: [Java] How to check groupId etc. described in pom.xml
How to deploy a kotlin (java) app on AWS fargate
How to install java9 on elementaryOS Freya or Ubuntu 14.04 LTS
How to check the database of apps deployed on Heroku
How to study Java Silver SE 8
How to use Java HttpClient (Get)
How to deploy jQuery on Rails
How to deploy Laravel on CentOS 7
How to install JMeter for Mac
Studying Java # 6 (How to write blocks)
Steps to run docker on Mac
How to "hollow" View on Android
How to make a Java container
How to install ImageMagick on Windows 10
How to disassemble Java class files
How to use Java HttpClient (Post)
[Java] How to use join method
How to use Ruby on Rails
How to deploy Bootstrap on Rails
How to run JavaFX on Docker
How to learn JAVA in 7 days