I have the following jdk versions jdk :

 * 0 /usr/lib/jvm/java-7-openjdk-armhf/jre/bin/java 1063 auto mode 1 /usr/lib/jvm/java-7-openjdk-armhf/jre/bin/java 1063 manual mode 2 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java 318 manual mode 

Java-7 the default. How do I switch to jdk-8 ? To call this version of java when calling java -jar .

  • If it were in Windows, it would most likely be solved by changing the environment variables. But you, as I understand it, Linux? .. - Ksenia
  • @Ksenia yes it is. - faoxis

1 answer 1

It looks like you can choose which version to use as follows:

 sudo update-alternatives --config java 

You will be offered a choice of available JREs, for example:

 There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-6-oracle/jre/bin/java 1070 auto mode 1 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1051 manual mode * 2 /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java 1069 manual mode Press enter to keep the current choice[*], or type selection number: 

This is a translation of the answer to the question Setting JDK 7 as default to AskUbuntu.