JDK version 1.7.0 update 45
Linux Mint 15 x86-64
Reference: http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux
Linux Mint 15 x86-64
Reference: http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux
- Remove OpenJDK
- sudo apt-get purge openjdk-\*
- sudo mkdir -p /usr/local/java
- sudo cp -r jdk-7u45-linux-x64.tar.gz /usr/local/java
- cd /usr/local/java
- Extract the archive:
- sudo chmod a+x jdk-7u45-linux-x64.tar.gz
- sudo tar xvzf jdk-7u45-linux-x64.tar.gz
- Create a symbolic link as: jdk7 -> jdk1.7.0_u45
- sudo ln -s jdk1.7.0_45 jdk7
This is so to avoid doing all the steps when the next time we update the jdk then we just change the jdk7 symbolic link to point to the then latest jdk.
- Add JAVA_HOME to PATH environment variable:
- sudo gedit /etc/profile
- Paste and save:
JAVA_HOME=/usr/local/java/jdk7
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
- Inform Linux system where Oracle JDK is located:
- sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk7/bin/java" 1
- sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk7/bin/javac" 1
- sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk7/bin/javaws" 1
- Inform Linux system that Oracle JDK must be the default Java:
- sudo update-alternatives --set java /usr/local/java/jdk7/bin/java
- sudo update-alternatives --set javac /usr/local/java/jdk7/bin/javac
- sudo update-alternatives --set javaws /usr/local/java/jdk7/bin/javaws
- Reload /etc/profile.
- . /etc/profile
- Test to see if installation is correct:
- java -version
- javac -version
- javaws -version
No comments:
Post a Comment