How to Install Oracle Java on Ubuntu Linux? Java Performance Problems

How to Install Oracle Java on Ubuntu Linux? Java Performance Problems

Main reason of this problem is the installation of OpenJRE/JDK instead of OracleJRE/JDK

• Start by learning your java version by typing

java -version

• If you have OpenJDK installed on your system, you got something like this

java version "1.6.0_21" OpenJDK Runtime Environment (IcedTea6 1.10pre) (6b21~pre1-0lucid1) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

• Remove JDK and JRE by typing

sudo apt-get autoremove openjdk-6-jre
sudo apt-get autoremove openjdk-6-jdk

• Create a folder for new Java installation

sudo mkdir -p /usr/local/java

• Download Oracle JRE and/or JDK from http://www.oracle.com/ as TAR.GZ file

• Copy downloaded files into Java installation folder

sudo cp jdk-7-linux-x64.tar.gz /usr/local/java cd /usr/local/java

• Open compressed files into this directory

sudo chmod a+x jdk-7-linux-x64.tar.gz tar xvzf jdk-7-linux-x64.tar.gz

• Edit /etc/profile to change system path

sudo gedit /etc/profile

• Go to the end of the file and add similar lines for your java version, then save and exit.

JAVA_HOME=/usr/local/java/jdk1.7.0 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin JAVA_HOME=/usr/local/java/jre1.7.0 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin export JAVA_HOME export PATH

• Inform Ubuntu system about JDK/JRE location

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0/bin/javac" 1

• Inform Ubuntu system about default JDK/JRE

sudo update-alternatives --set java /usr/local/java/jre1.7.0/bin/java
sudo update-alternatives --set javac /usr/local/java/jdk1.7.0/bin/javac

• Reload your profile information

. /etc/profile

• Check your Java version again

javac -version


added 10 years ago

- What is MRI Scan?
- The most interesting facts about lions
- MKV vs MP4 (M4v)
- Turn PC off every night or leave it on 24/7?
- What resolution does the human eye see in?
- What does chess ELO ratings mean?
- Search Engine optimization: Google's 200 Ranking Factors
- iPhone 4S vs iPhone 5 vs Samsung Galaxy S3 comparison results
- How to Install Oracle Java on Ubuntu Linux? Java Performance Problems
- What is CSS and why is it useful?
- How to Use a Router as a Repeater?
- How to install Memcached on Win 7 + WAMP Server, the simplest way of all
- How to restart page numbering for each chapter in Word 2007 – 2010
2
1