jvm-home() {
JAVACMD=$(which echo) "$1" | tr -s '[:space:]' '\n' | grep -F "$1.home=" | cut -d= -f2
}
$ jvm-home groovy
/usr/share/groovy
$ jvm-home kotlin
/usr/share/kotlin
$ jvm-home scala
/usr/share/scala
See here for the how.
jvm-home() {
JAVACMD=$(which echo) "$1" | tr -s '[:space:]' '\n' | grep -F "$1.home=" | cut -d= -f2
}
$ jvm-home groovy
/usr/share/groovy
$ jvm-home kotlin
/usr/share/kotlin
$ jvm-home scala
/usr/share/scala
See here for the how.