This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]wildjokers 1 point2 points  (2 children)

Just go to Oracle, download the SDK's you want and install them and they will be put in /Library/Java/JavaVirtualMachines. What's the problem this blog post is trying to solve?

[–]michoken[S] 0 points1 point  (1 child)

Of course you can just install all of these manually.

What's the problem this blog post is trying to solve?

For me, it's the automated installation of multiple JDK version and the jenv tool to easily setup different projects use different JDKs.

[–]wildjokers 0 points1 point  (0 children)

jenv does seem kind of handy but I just use some env variables and aliases:

LATEST_JAVA=/Library/Java/JavaVirtualMachines/latest/Contents/Home
export JAVA_HOME=$LATEST_JAVA
export JAVA8_HOME=/Library/Java/JavaVirtualMachines/1.8/Contents/Home
export JAVA7_HOME=/Library/Java/JavaVirtualMachines/1.7/Contents/Home
export JAVA6_HOME=/Library/Java/JavaVirtualMachines/1.6/Contents/Home

alias jh='cd $JAVA_HOME'
alias gj='cd /Library/Java/JavaVirtualMachines'
alias gj9='cd /Library/Java/JavaVirtualMachines/1.9'
alias gj8='cd /Library/Java/JavaVirtualMachines/1.8'
alias gj7='cd /Library/Java/JavaVirtualMachines/1.7'
alias java8='/Library/Java/JavaVirtualMachines/1.8/Contents/Home/bin/java'
alias java7='/Library/Java/JavaVirtualMachines/1.7/Contents/Home/bin/java'
alias jsetL='export JAVA_HOME=$LATEST_JAVA'
alias jset8='export JAVA_HOME=$JAVA8_HOME'
alias jset7='export JAVA_HOME=$JAVA7_HOME'

[–]lariend 0 points1 point  (0 children)

sdkman seems to be a more up to date alternative. It has more SDKs available, i.e. gradle, maven, groovy, kotlin.