I am looking for a tool that would let me switch the running Java implementation, like Ruby's RVM (or RBENV). I am aware that Debian systems provide the alternatives mechanism, and that I can set JAVA_HOME manually.
However, I'd like something more automated if possible. If it could fetch JDKs that would be even better, but not necessary.
I've searched but didn't see anything like it. My guess the Java ecosystem got used to having this functionality in an IDE.
Edit: Changing PATH and JAVA_HOME seems to work fine. It could be trivially automated.
Byte-addressable, non-volatile memory (NVM) is emerging as a revolutionary memory technology that provides persis- tency, near-DRAM performance, and scalable capacity. To facilitate its use, many NVM programming models have been proposed.
In the Java Control Panel, click on the Java tab. Verify that the latest Java Runtime version is enabled by checking the Enabled box. Click OK in Java Control Panel window to confirm changes and close the window. Try to run same applet and verify it is now running using latest version of Java installed in your system.
There's jenv, based on Ruby's RVM.
You have to go through some manual steps to add new Java versions†, but once they're in you can switch between them using jenv use java $version
. It also handles installing Java applications against specific Java versions.
There's also another tool that I haven't used, confusingly also named jenv but based on Ruby's rbenv instead.
† The hassle adding Java versions appears to be due to Oracle, perhaps licensing issues, and seems to apply to both tools.
I think there is no such tool. Every platform has hits own system. Debian/Ubuntu, RedHat/CentOS and SLE/OpenSUSE ( probably some other distributions as well) use the alternative mechanism. Mac OSX has its own buildin switching mechanism to change the current used JVM.
I have to maintain a lot of developer workstations and servers. All *nix based (OSX, Linux, Solaris) and used to install all JVMs in a directory and create a symlink CURRENT to the Version that should be used. The JAVA_HOME and PATH variable pointing to this CURRENT symlink. If Ia want to use another version only haf to move the CURRENT symlink. No further actions are necessary.
Unfortunately this approach does not work for Windows based systems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With