VAR-SOM-MX6 Android GS-java: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 10: Line 10:


If you get the following result, you already have Java 6 update 37 installed and can ignore the rest of the steps:
If you get the following result, you already have Java 6 update 37 installed and can ignore the rest of the steps:
1
2
3
java version "1.6.0_45"
java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Step 2: Download Oracle Java.


When new versions of Java get released, they feature on the main Java download page. If Java 6 update 45 is no longer featured, you can find the download by using this Previous Releases link found on the main download page. Open the Java download page in your browser and download both jdk-6u45-linux-i586.bin and jre-6u45-linux-i586.bin Make a note of the folder to which you downloaded the files.
Step 1:
Step 3: Create the installation folder.
<pre>$ sudo mkdir -p /usr/lib/jvm
</pre>
The –p option ensures that all folders in the mkdir path 1s created.
Step 2:
Download jdk-6u45-linux-x64.bin and jre-6u45-linux-x64.bin from:
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jre-6u45-oth-JPR
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
 
Step 3: Navigate to the folder to which you downloaded the Java installation files. Typicly
<pre>$ cd ~/Download
</pre>


The usr/lib/jvm is the default installation directory of the Java JDK and the Java JRE. Enter the following command in your console:
Step4:
1
<pre>$ sudo mv jdk-6u45-linux-x64.bin  /usr/lib/jvm
$ sudo mv jre-6u45-linux-x64.bin /usr/lib/jvm
</pre>
sudo mkdir -p /usr/lib/jvm
Step 5: Change to the installation folder.
<pre>$ cd /usr/lib/jvm
</pre>


The –p option ensures that all folders in the mkdir path 1s created.
Step 6: Make the downloaded binaries executable.
Step 4: Navigate to the folder to which you downloaded the Java installation files.
<pre>$ sudo chmod a+x jdk-6u45-linux-x64.bin
$ sudo chmod a+x jre-6u45-linux-x64.bin
</pre>


If you downloaded the files to your Home folder, you can use the following command:
Step 7: Extract both compressed binary files.
1
<pre>$ sudo ./jdk-6u45-linux-i586.bin
$ sudo ./jre-6u45-linux-i586.bin
cd ~/
</pre>
Step 5: Move the downloaded files to the installation folder.
1
2
sudo mv jdk-6u45-linux-i586.bin /usr/lib/jvm
sudo mv jre-6u45-linux-i586.bin /usr/lib/jvm
Step 6: Change to the installation folder.
1
cd /usr/lib/jvm
Step 7: Make the downloaded binaries executable.
1
2
sudo chmod u+x jdk-6u45-linux-i586.bin
sudo chmod u+x jre-6u45-linux-i586.bin
Step 8: Extract both compressed binary files.
1
2
sudo ./jdk-6u45-linux-i586.bin
sudo ./jre-6u45-linux-i586.bin
Step 9: Check your extracted folder names.
1
ls -l


Step 8: Check your extracted folder names.
<pre>$ ls -l
</pre>
Response:
Response:
1
2
jdk1.6.0_45
jdk1.6.0_45
jre1.6.0_45
jre1.6.0_45
Step 10: Inform Ubuntu where your Java installation is located.
 
1
Step 9: Inform Ubuntu where your Java installation is located.
2
<pre>$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.6.0_45/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install &quot;/usr/bin/java&quot; &quot;java&quot; &quot;/usr/lib/jvm/jre1.6.0_45/bin/java&quot; 1
</pre>
sudo update-alternatives --install &quot;/usr/bin/javac&quot; &quot;javac&quot; &quot;/usr/lib/jvm/jdk1.6.0_45/bin/javac&quot; 1
 
Step 11: Inform Ubuntu that this is your default Java installation.
Step 10: Inform Ubuntu that this is your default Java installation.
1
<pre>$ sudo update-alternatives --set java /usr/lib/jvm/jre1.6.0_45/bin/java
2
$ sudo update-alternatives --set javac /usr/lib/jvm/jdk1.6.0_45/bin/javac
</pre>
sudo update-alternatives --set java /usr/lib/jvm/jre1.6.0_45/bin/java
 
sudo update-alternatives --set javac /usr/lib/jvm/jdk1.6.0_45/bin/javac
Step 12: Update your system-wide PATH.
Step 12: Update your system-wide PATH.
Edit your /etc/profile file using:
Edit your /etc/profile file using:
1
<pre>$ sudo gedit /etc/profile
</pre>
sudo nano /etc/profile


Add the following entries to the bottom of the file:
Add the following entries to the bottom of the file:
1
2
3
4
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JAVA_HOME
export PATH
export PATH
Save your changes and exit


Save your changes using CTRL + X.
Step 12: Reload your system-wide PATH.
Step 13: Reload your system-wide PATH.
<pre>$ . /etc/profile
1
</pre>
Step 13: Test your new installation.
. /etc/profile
<pre>$ java –version
Step 14: Test your new installation.
</pre>
1
java –version
 
Response:
Response:
1
java version "1.6.0_45"
2
3
java version &quot;1.6.0_45&quot;
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
 
<pre>$ javac -version
</pre>
1
javac –version
 
Response:
Response:
1
javac 1.6.0_45
javac 1.6.0_45
Step 15: Congratulations! You have just installed Oracle Java on Ubuntu Linux!
 
Step 14: Congratulations! You have just installed Oracle Java on Ubuntu Linux!

Revision as of 12:03, 9 February 2014

How to Install Oracle Java 6 update 45 on Ubuntu 12.04-64 Linux

Based on:
http://hendrelouw73.wordpress.com/2013/05/07/how-to-install-oracle-java-6-update-45-on-ubuntu-12-04-linux/

This is a step-by-step installation of Java on Ubuntu 64.

Open your console window and enter the following command:

$ java –version

If you get the following result, you already have Java 6 update 37 installed and can ignore the rest of the steps:

java -version java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

Step 1:

$ sudo mkdir -p /usr/lib/jvm

The –p option ensures that all folders in the mkdir path 1s created. Step 2: Download jdk-6u45-linux-x64.bin and jre-6u45-linux-x64.bin from: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jre-6u45-oth-JPR http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

Step 3: Navigate to the folder to which you downloaded the Java installation files. Typicly

$ cd ~/Download

Step4:

$ sudo mv jdk-6u45-linux-x64.bin  /usr/lib/jvm
$ sudo mv jre-6u45-linux-x64.bin /usr/lib/jvm

Step 5: Change to the installation folder.

$ cd /usr/lib/jvm

Step 6: Make the downloaded binaries executable.

$ sudo chmod a+x jdk-6u45-linux-x64.bin 
$ sudo chmod a+x jre-6u45-linux-x64.bin

Step 7: Extract both compressed binary files.

$ sudo ./jdk-6u45-linux-i586.bin
$ sudo ./jre-6u45-linux-i586.bin

Step 8: Check your extracted folder names.

$ ls -l

Response: jdk1.6.0_45 jre1.6.0_45

Step 9: Inform Ubuntu where your Java installation is located.

$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.6.0_45/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1

Step 10: Inform Ubuntu that this is your default Java installation.

$ sudo update-alternatives --set java /usr/lib/jvm/jre1.6.0_45/bin/java
$ sudo update-alternatives --set javac /usr/lib/jvm/jdk1.6.0_45/bin/javac

Step 12: Update your system-wide PATH. Edit your /etc/profile file using:

$ sudo gedit /etc/profile

Add the following entries to the bottom of the file: JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin export JAVA_HOME export PATH Save your changes and exit

Step 12: Reload your system-wide PATH.

$ . /etc/profile

Step 13: Test your new installation.

$ java –version

Response: java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

$ javac -version

Response: javac 1.6.0_45

Step 14: Congratulations! You have just installed Oracle Java on Ubuntu Linux!