mirror of
https://github.com/jbranchaud/til
synced 2026-01-06 00:28:01 +00:00
Add List The Available JDKs as a unix til
This commit is contained in:
17
unix/list-the-available-jdks.md
Normal file
17
unix/list-the-available-jdks.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# List The Available JDKs
|
||||
|
||||
Want to know what JDK versions are installed and available on your machine?
|
||||
There is a command for that.
|
||||
|
||||
```bash
|
||||
$ /usr/libexec/java_home -V
|
||||
Matching Java Virtual Machines (3):
|
||||
9.0.4, x86_64: "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
|
||||
1.8.0_162, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
|
||||
1.8.0_161, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
|
||||
|
||||
/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
|
||||
```
|
||||
|
||||
The listed VMs show what JDK versions you have and the final line shows
|
||||
which is currently the default version.
|
||||
Reference in New Issue
Block a user