Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5956

How to switch between different java versions in Linux?

$
0
0

I manually installed Java 8 and installed Java 11 via command line (open-jdk). I'm a noob at linux and don't know how to switch between the versions.

I ran the following commands to change the default version.

update-alternatives --config java

Returns:

  Selection    Path                                         Priority   Status------------------------------------------------------------* 0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   1101      auto mode  1            /opt/java/jdk1.8.0_211/bin/java               1         manual mode  2            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   1101      manual mode

And

update-alternatives --config javac

Returns:

There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-11-openjdk-amd64/bin/javacNothing to configure.

Viewing all articles
Browse latest Browse all 5956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>