DEV Community

Cover image for SDKMan, adding unlisted versions
Arthur Fonseca
Arthur Fonseca

Posted on

SDKMan, adding unlisted versions

SDKMan is a fantastic tool, I believe no one has doubts! Since I installed it, my concerns with Gradle, Java, Kotlin versions, among other SDKs ended... As a JVM developer, just not needing to adjust the infamous JAVA_HOME, M2_HOME and others, have already turned my days into happier days.

Something, however, gave me a certain headache that I would like to share with you:

I recently started implementing a project with Java 12. At first, I thought, just install this version with SDKMan, however, I was mistaken... the version didn't appear on any of the vendors when I ran sdk list java.

sdk list java

I still don't understand the reason for this gap, but I started to think about alternatives... I could install the version 16 and make use of the Java retrocompatibility, however, this started to look as a work around.

I even thought about installing the pre-SDKMan, however, I was wondering how the Java version management at two distinct points on my operating system, in addition to possible changes to my POM to avoid compilation version errors. After some research I found post on StackOverflow, a solution that I thought was more elegant.:

It seems that downloading the missing version, then unpacking to: ~/.sdkman/candidates/java/ then renaming the extracted directory solves the problem.

With that, I continued using only 1 manager of Java in my operational system, taking advantage of the facilities of SDKMan! SDKMan is life!!!

Discussion (0)