In this short post i will show you how to easily change your java version and your java compiler version on your Ubuntu / Linux machine.
If you have installed more than one version of java on your system, you still have the opportunity to switch between different versions. Maybe you wanted to check out the newest features of the new java version or you have some kind of old project that only works for some older version (yes i know java ist a wora language but anyway).
If that is the case try the following commands:
$ update-alternatives --config java
$ update-alternatives --config javac
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-11-openjdk-armhf/bin/java 1061 auto mode
1 /usr/lib/jvm/java-11-openjdk-armhf/bin/java 1044 manual mode
2 /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java 1061 manual mode
Press enter to keep the current choice[*], or type selection number:
Enter fullscreen mode Exit fullscreen mode
After choosing one of the numbers you will be good to go.
If post was helpful you could try following me on
twitter
or check out my new blog
原文链接:How to change your Java and javac version on Ubuntu / Linux
暂无评论内容