DEV Community

Managing JDKs in MacOS

Nikos Katsanos on March 25, 2020

With the increasing number of JDK builds and the more frequent release cadence, I found it hard to keep track what I had installed in my MacOS and ...
Collapse
 
philippsuntz profile image
philippsuntz

Hi Nikos,

nice article. I had to same, needing to change my JDK for multiple projects with a new developed and a legacy code base. For me i found sdkman very helpful (sdkman.io/).
It dose the same job as your script + it allows you to download additional JDKs if needed. Also tools like gradle can be managed with it and maintained in multiple versions.

Collapse
 
nikos_katsanos profile image
Nikos Katsanos

Hey Philip, Thank you for the suggestion. Didn't know about that, but it looks pretty cool and promising. Will give it a go. I definitely prefer something that is supported by many people :)

Collapse
 
shostarsson profile image
Rémi Lavedrine

Hi Nikos,

I encountered this problem using an SDK for iOS application obfuscation.
I used jenv and it works pretty well.

Collapse
 
nikos_katsanos profile image
Nikos Katsanos

Hello Rèmi, thank you for suggesting. Seems like managing JDKs in a Mac/Dev machine is a general concern. jevn looks promising as well. Pretty sure this and http:// sdkman.io as suggested above will be much better than my hacky scripts :)

Collapse
 
shostarsson profile image
Rémi Lavedrine

I explained how I made it in that Post :

It is basically :

brew install jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile
source ~/.bash_profile