Skip to content

Instantly share code, notes, and snippets.

@faleev
Created May 22, 2013 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faleev/5627504 to your computer and use it in GitHub Desktop.
Save faleev/5627504 to your computer and use it in GitHub Desktop.
Install JDK on Ubuntu
  • Download JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • Unpack archive (name of archive could be different due to newest JDK version):

      tar -xvf ./jdk-7u9-linux-i586.tar.gz
    
  • Create directory for JDK:

      sudo mkdir /usr/lib/jvm/java-7u9-jdk-i586
    
  • Move new JDK to the target directory:

      sudo mv ./jdk1.7.0_09/* /usr/lib/jvm/java-7u9-jdk-i586
    
  • Maintain symbolic links determining default commands for Java:

  • Add JDK targets:

      sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-7u9-jdk-i586/bin/java" 1
      sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-7u9-jdk-i586/bin/javac" 1
      sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java-7u9-jdk-i586/bin/javaws" 1
    
  • Activate JDK tardets:

      sudo update-alternatives --config java
      sudo update-alternatives --config javac
      sudo update-alternatives --config javaws
    
  • Activate Java plugin for Mozilla (and Cromium as well):

  • Create plugin directory:

      mkdir ./.mozilla/plugins
    
  • Create symlink:

      ln -s /usr/lib/jvm/java-7u9-jdk-i586/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment