Skip to content

Instantly share code, notes, and snippets.

@kokoye2007
Last active October 21, 2017 12:53
Show Gist options
  • Save kokoye2007/39bd19165eb58e88eb7ebcf1b2814d93 to your computer and use it in GitHub Desktop.
Save kokoye2007/39bd19165eb58e88eb7ebcf1b2814d93 to your computer and use it in GitHub Desktop.

DEFAULT

sudo apt-get update

JRE (Java Runtime Environment)

sudo apt-get install default-jre

JDK (Java Development Kit)

sudo apt-get install default-jdk

Installing the Oracle JDK

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

6 or 7 or else Oracle JDK

sudo apt-get install oracle-java6-installer

sudo apt-get install oracle-java7-installer

sudo apt-get install oracle-java8-installer

sudo apt-get install oracle-java9-installer

Update Alternative

sudo update-alternatives --config java

JAVA_HOME Environment

Copy file path

sudo update-alternatives --config java

Edit /etc/environment (nano / vi / gedit / leafpad whatever)

sudo nano /etc/environment

Copy and paste path (java 6~9)

JAVA_HOME="/usr/lib/jvm/java-8-oracle"

use it now.

source /etc/environment

check it

echo $JAVA_HOME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment