Java Version Management - jambit ToiletPaper

Java Version Management with jEnv

Problem: Working with several Java versions

Java Version Releases over the years
Time between Java version releases

On my first day at jambit, I picked up my laptop and installed JDK 1.8. After that, I was able to develop cool Java applications for our customers for several years without any great changes. But ever since September 2017, a new Java version has been released every 6 months.

This means that I often work on code bases compiled with different Java versions at the same time. Sometimes there are two separate projects. But it is also quite possible that there are two microservices in the same project.

The simple switching between different Java versions is therefore essential.

The solution: Quick switching with jEnv

Among many options, jEnv offers the possibility to switch between different Java versions quickly and easily.

Example

After the successful installation, you first add all Java versions available on your computer to jEnv-Configs.

Afterwards, you can set the global version in jEnv or list the existing versions at any time.

$ jenv global oracle64-13.0.2
$ jenv versions
  system
  oracle64-1.8.0.202
* oracle64-13.0.2 (set by /Users/jambitUser/.jenv/version)

You can always see the current Java version with jenv version and the path of executables with jenv which java.

A useful feature of jEnv is that you can set different Java versions on the directory level.

../foo:~$ jenv local oracle64-13.0.2
../bar:~$ jenv local oracle64-1.8.0.202

The directory /foo uses Java 13 and the directory /bar uses Java 8. The version for a shell session is set a similar way.

Further Aspects

---

Author: Dvin Galstian / Senior Software Architect / Business Division New Business

Java Version Management mit jEnv

Cookie Settings

This website uses cookies to personalize content and ads, provide social media features, and analyze website traffic. In addition, information about your use of the website is shared with social media, advertising, and analytics partners. These partners may merge the information with other data that you have provided to them or that they have collected from you using the services.

For more information, please refer to our privacy policy. There you can also change your cookie settings later on.

contact icon

Contact us now