Saturday, 29 November 2014

Install Java JDK in Ubuntu

I recently had to install Java to be able to run Cooja properly, as surely I'm going to need this at any given moment when reinstalling, testing elsewhere, etc, I'm keeping the instructions here.

Taken from Ubuntu Guia.

Install Java Oracle version 8:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Check the current version

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) Server VM (build 25.25-b02, mixed mode)

You can select between any installed Java version at any given time

$ sudo /usr/sbin/update-alternatives --config java

There are 4 choices for the alternative java
  Selection    Path                                           Priority   Status
  0            /usr/lib/jvm/java-8-oracle/jre/bin/java         1063      auto mode
  1            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-8-oracle/jre/bin/java         1063      manual mode
  3            /usr/lib/jvm/jdk1.8.0/bin/java                  1         manual mode
  4            /usr/lib/jvm/jre1.7.0/jre1.7.0_51/bin/java      0         manual mode
Press enter to keep the current choice[*], or type selection number:

No comments: