Wednesday, July 8, 2015

Installing JDK 8 on Debian Wheezy

By default, Debian Wheezy repository does not provide JDK-8 and JRE-8. You can download it from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. If you install JDK-8 using remove SSH, you can follow these steps:
  1. Download JDK-8 from URL above
    # wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz
  2. Extract it
    # tar xvzf jdk-8u45-linux-x64.tar.gz
  3. Create directory /usr/lib/JVM, if it does not exist. By default JDK will install on these folder
    # mkdir /usr/lib/jvm/
  4. Move JDK-8 folder to /usr/lib/JVM
    # mv jdk1.8.0_45 /usr/lib/jvm/
  5. Update alternative Java
    # update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_45/bin/java 100
    update-alternatives: using /usr/lib/jvm/jdk1.8.0_45/bin/java to provide /usr/bin/java (java) in auto mode
    # update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_45/bin/javac 100
    update-alternatives: using /usr/lib/jvm/jdk1.8.0_45/bin/javac to provide /usr/bin/javac (javac) in auto mode

No comments:

Post a Comment