Tuesday, October 18, 2016

Install Oracle Java jdk

Install Oracle Java 

## Change the number 8 to 6 (or 7) in the code to install Java 6 (or 7)

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

## Set JAVA HOME path: sudo vim /etc/profile.d/oraclejdk.sh, and add the following config
    export J2SDKDIR=/usr/lib/jvm/java-8-oracle
    export J2REDIR=/usr/lib/jvm/java-8-oracle/jre
    export PATH=$PATH:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-
        oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
    export JAVA_HOME=/usr/lib/jvm/java-8-oracle
    export DERBY_HOME=/usr/lib/jvm/java-8-oracle/db

No comments:

Post a Comment