DevotionGeo

DevotionGeo

How to install multiple Java versions?

The version of Java installed with Android Studio on my Mac is the following (when I run java -version)

openjdk version "1.8.0_242-release"
OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
OpenJDK 64-Bit Server VM (build 25.242-b3-6915495, mixed mode)

An hour later I’m taking an online class and one of the prerequisites is OpenJDK 11.
How do I install both of the versions side by side on my Mac if I don’t have ASDF.

Most Liked

finner

finner

hi @DevotionGeo - I now use sdkman to switch through my Java versions.
Here is the usage page.
On a mac the java sdks will be installed :

/Users/<you>/.sdkman/candidates/java/

In my case I have the following

/Users/<user>/.sdkman/candidates/java/11.0.2-open
/Users/<user>/.sdkman/candidates/java/12.0.2.j9-adpt
/Users/<user>/.sdkman/candidates/java/15.0.2.j9-adpt
current -> /Users/<user>/.sdkman/candidates/java/11.0.2-open

current is a symbolic link which points to the version you are currently using, so from inside an IDE you would have to point to the real folder.

Not sure of that helps you at this stage.

finner

finner

hi @DevotionGeo - I’ve never even heard of asdf before :blush:
From what I can see about asdf it manages multiple languages, if you are constantly switching between languages and then versions within those languages then maybe asdf will work well for you. But as I’ve said, I have never used it.
If you do decide to use it let me know what you think.

ohm

ohm

I’ve previously used jenv for handling multiple versions of Java (for use with JRuby), but if you’re already using asdf I think you should just continue with that and not introduce yet another new tools.

Popular General Dev topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
Dusty
Thanks to @AstonJ for encouraging me to post this here: An introduction to alternative keyboard layouts Feel free to post your own expe...
New
AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
New
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New
AstonJ
Perhaps we can add some vids on sound differences, those I’ve seen so far are giving the plastic cases a nice stock sound (you could do s...
New
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
First poster: bot
Apple’s Tim Cook to take 50% pay hit after shareholder feedback. ‘Target compensation’ for CEO down from $99.4m in 2022 to an expected $...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New