1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-04 23:58:01 +00:00

Add List The Available JDKs as a unix til

This commit is contained in:
jbranchaud
2018-02-08 10:37:25 -06:00
parent a32771e3dc
commit b0e44df12e
2 changed files with 19 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
For a steady stream of TILs from a variety of rocketeers, checkout
[til.hashrocket.com](https://til.hashrocket.com/).
_607 TILs and counting..._
_608 TILs and counting..._
---
@@ -559,6 +559,7 @@ _607 TILs and counting..._
- [List Names Of Files With Matches](unix/list-names-of-files-with-matches.md)
- [List Of Sessions To A Machine](unix/list-of-sessions-to-a-machine.md)
- [List Parent pid With ps](unix/list-parent-pid-with-ps.md)
- [List The Available JDKs](unix/list-the-available-jdks.md)
- [Map A Domain To localhost](unix/map-a-domain-to-localhost.md)
- [Only Show The Matches](unix/only-show-the-matches.md)
- [Open The Current Command In An Editor](unix/open-the-current-command-in-an-editor.md)

View 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.