How-to Install Oracle-Sun Java JDK 7 on Arch-Linux 64bit Easy Guide

November 15th, 2012 by Regaz

Oracle JDK 7 Quick-Start for Arch Linux




The Linux Tutorial Shows You Step-by-Step How-to Install and Getting-Started with the Latest Oracle-Sun Official Java JDK 7 on Arch-Linux 2012/2013/2014/2015 x8664 Desktop/Server.

After Installing you will need to Update your System Env Variables and PATH to make Arch-Linux Aware of the Java JDK Installation.




To Make the Entire Process Easier to Visualize and Retain the Post Includes the Basic Screenshots of the Essentials Steps Involved.

The Content give Focus Only to the Essentials Instructions and Commands to make it Easier to Understand;)

Install Oracle JDK 7 for Arch Linux - Featured
  1. Open a Terminal Window
    (Press “Enter” to Execute Commands)

    Install Oracle JDK 7 for Arch Linux - Open Terminal Window

  2. Download Oracle Java SE JDK 7:

    Oracle JDK 7 x64.tar.gz
  3. Find and Double-Click on the tar.gz Archive
    Install Oracle JDK 7 for Arch Linux - tar.gz Extraction 1

    Extract it Into the /tmp Folder.

    Install Oracle JDK 7 for Arch Linux - tar.gz Extraction Path

    Or from Shell:

    tar xvzf ~/Downloads/jdk-7*.tar.gz -C /tmp/
  4. Relocate Oracle JDK 7

    su 

    If Got “User is Not in Sudoers file” then Look: Solution

    chmod +x /tmp/jdk1.7*/bin
    if [ ! -d "/usr/lib/jvm" ]; then mkdir /usr/lib/jvm; fi

    The above command is used to create a jvm directory if not already there.

    chown -R root:root /tmp/jdk1.7*

    Reiterate the Execution Permission over the Java binaries

    chmod -R +x /tmp/jdk1.7*/bin

    Finally Shift the Java content with

    mv /tmp/jdk1.7* /usr/lib/jvm/
  5. SetUp the Java JDK Environment Variables

    nano /etc/profile.d/oraclejdk7.sh

    export J2SDKDIR=/usr/lib/jvm/jdk1.7.0_UPDATE
    export J2REDIR=$J2SDKDIR/jre
    export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_UPDATE

    Substitute the Right UPDATE on Quote.

    Ctrl+x to Save & Exit :)

    nano /etc/profile.d/oraclejdk7.csh

    setenv J2SDKDIR=/usr/lib/jvm/jdk1.7.0_UPDATE
    setenv J2REDIR=$J2SDKDIR/jre
    setenv JAVA_HOME=/usr/lib/jvm/jdk1.7.0_UPDATE

    Substitute the Right UPDATE on Quote.

  6. SetUp Java JDK Path

    Check if Another Jdk Releases is Already Installed:

    pacman -Q | grep jdk
    • If Yes then provide to Rename the Config Files in /etc/profile.d:

      mv /etc/profile.d/[javapackagename].sh /etc/profile.d/[javapackagename].sh.back
      mv /etc/profile.d/[javapackagename].csh /etc/profile.d/[javapackagename].csh.back

      LogOut and LogIn Again

      Then provide to Modify the Simlinks to Java Executables:

      ln -fs $JAVA_HOME/bin/java /usr/bin/java
      ln -fs $JAVA_HOME/bin/javac /usr/bin/javac
      ln -fs $JAVA_HOME/bin/jre /usr/bin/jre
      ln -fs $JAVA_HOME/bin/javaws /usr/bin/javaws
    • If Not then will be Enough to Edit the Bash Config file for the User:

      exit
      nano ~/.bashrc

      Inserts:

      export PATH="$JAVA_HOME/bin:$PATH"

      Load New Settings:

      source ~/.bashrc
(Visited 28 times, 1 visits today)
Share on Tumblr

Tags: , , , , , , , , , , , , , ,


Comments are disabled