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.

Where Next?

Popular General Dev topics Top

Jase
Any opinions on the best platform for dev-friendly blogging?
New
Jase
Do they publish their stacks or is it mostly a case of guesswork? Twitter facebook instagram snapchat tiktok google et all. Used to be we...
New
Kurisu
You can go directly to the last paragraph of this post to read about my concern. I was trying Git submodules then found the above po...
New
dimitarvp
What does a developer advocate do for a living? I mean, what is it that you are paid to do? I’ve seen your description below but it doesn...
New
AstonJ
Stopwords are words that you normally filter for things like search queries, such as ‘as’, ‘because’ etc - there are a few online, but I ...
New
harwind
Consider the following bits of code: void foo(const int i) // First foo { std::cout &lt;&lt; "First " &lt;&lt; i &lt;&lt; endl; } vo...
New
thetoaderseventytwo
I’ve been trying to dip my feet into using Unity and C# for the sake of developing games, however, I have barely any knowledge of how to ...
New
harwind
Hi, I’m now investigating the complexities of Python loops, specifically the contrast between for and while loops. However, I’ve had some...
New
GTX
Hello everyone! I am not a developer, just wanna know if it’s possible for someone with no skills to learn how to reverse hack my hackers.
New
New

Other popular topics Top

AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
New
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New