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 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/technetwork/java/javase/downloads/index.html 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 4 years ago

- What does chess ELO ratings mean?
- WAMP Mysqli: Your password has expired
- Search Engine optimization: Google's 200 Ranking Factors
- MySQL Dump/Restore, Dumping MySQL Database and Tables using MysqlDump command
- iPhone 4S vs iPhone 5 vs Samsung Galaxy S3 comparison results
- Source Code of Matrix Multiplication
- How to Install Oracle Java on Ubuntu Linux? Java Performance Problems
- How to create your own PHP caching system? A simple example
- What is CSS and why is it useful?
- Domain Life Cycle
- How to Use a Router as a Repeater?
- Comparison of Random Functions According to their Exploration Performance (STL, .NET, Java)
- How to install Memcached on Win 7 + WAMP Server, the simplest way of all
- How to draw double buffered in C# or Java using GDI+
- How to restart page numbering for each chapter in Word 2007 – 2010
- How to recover Ubuntu after installing Windows using Ubuntu live cd