DEV Community

Discussion on: #RoastMySetup

Collapse
 
hmijail profile image
Horacio Mijail Antón Quiles

Why use SDKMAN and jenv? The whole idea of both is to simplify management, and SDKMAN's functionality is (mostly?) a superset of jenv's, so... why complicate things by using both?

Collapse
 
awwsmm profile image
Andrew (he/him)

Maybe one exists, but I haven't yet found a way to quickly and easily switch between Java versions with SDKMAN. With jenv, it's as easy as:

$ java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

$ jenv global 1.8

$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
gregas profile image
greg

I too had this quandary of loving the ease of use with jenv, but wanted sdkman for ease of installing multiple different jdk's, in addition to all the other supported tools, gradle, groovy, scala, etc.. I finally looked into the issue of switching environments easily and noticed the command 'sdk env'. From there I found this excellent write up on using it on blog.mrhaki.com

Automatic Switching Of Java Versions With SDKMAN!