DEV Community

Discussion on: How to Install and Manage Multiple Versions of Java (hint: jabba and jEnv)

Collapse
 
prahladyeri profile image
Prahlad Yeri

Is this really necessary when all you need to do is set the JAVA_HOME environment variable to the path of whatever Java you want to use?

On Linux, its as simple as opening your ~/.profile in vim/nano and changing a variable. If you use an IDE like eclipse/netbeans, that allows you to set your preferred JDK too.

Collapse
 
mjclemente profile image
Matthew J. Clemente

It's certainly not "necessary". Using jabba to install different versions of the JDK is very convenient, but it could be done manually. The benefit/appeal of using jEnv is going to depend on the nature of your projects, as well as personal preferences. I tend to have a number of different projects going on, and jump between Intellij and the terminal, so I really appreciate being able to set the JDK version in the folder once. That is, I'd rather not be bothered with setting JAVA_HOME as I move from project to project, or get caught using the wrong version of the JDK because I forgot to change it. That said, it's not hard to imagine workflows where this isn't needed at all. The post is more of a guide for those who, for whatever reason, would like this type of control.