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

From Variscite Wiki
 
(10 intermediate revisions by the same user not shown)
Line 29: Line 29:
</pre>
</pre>


== Step 4:  Move the downloaded files to the installation folder ==
== Step 4:  Exctract images to the installation folder ==
<pre>$ sudo tar xvf jdk-7u79-linux-x64.tar.gz -C /usr/lib/jvm/
<pre>$ sudo tar xvf jdk-7u79-linux-x64.tar.gz -C /usr/lib/jvm/
$ sudo tar xvf jre-7u79-linux-x64.tar.gz -C /usr/lib/jvm/
$ sudo tar xvf jre-7u79-linux-x64.tar.gz -C /usr/lib/jvm/
Line 43: Line 43:
</pre>
</pre>


== Step 7: Extract both compressed binary files. ==
== Step 7: Check your extracted folder names. ==
<pre>$ sudo ./jdk-6u45-linux-x64.bin
$ sudo ./jre-6u45-linux-x64.bin
</pre>
 
== Step 8: Check your extracted folder names. ==
<pre>$ ls -l
<pre>$ ls -l
</pre>
</pre>
Response:
Response:
jdk1.6.0_45
jdk1.7.0_79, jre1.7.0_79
jre1.6.0_45


== Step 9: Inform Ubuntu where your Java installation is located. ==
== Step 8: Inform Ubuntu where your Java installation is located. ==
<pre>$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.6.0_45/bin/java 1
<pre>$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_79/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 /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_79/bin/javac 1
</pre>
</pre>


== Step 10: Inform Ubuntu that this is your default Java installation. ==
== Step 9: Inform Ubuntu that this is your default Java installation. ==
<pre>$ sudo update-alternatives --set java /usr/lib/jvm/jre1.6.0_45/bin/java
<pre>$ sudo update-alternatives --set java /usr/lib/jvm/jre1.7.0_79/bin/java
$ sudo update-alternatives --set javac /usr/lib/jvm/jdk1.6.0_45/bin/javac
$ sudo update-alternatives --set javac /usr/lib/jvm/jdk1.7.0_79/bin/javac
</pre>
</pre>


== Step 11: Update your system-wide PATH. ==
== Step 10: Update your system-wide PATH. ==
Edit your /etc/profile file using:
Edit your /etc/profile file using:
<pre>$ sudo gedit /etc/profile
<pre>$ sudo gedit /etc/profile
Line 71: Line 65:


Add the following entries to the bottom of the file:<br>
Add the following entries to the bottom of the file:<br>
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45<br>
JAVA_HOME=/usr/lib/usr/lib/jvm/jdk1.7.0_79/<br>
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin<br>
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin<br>
export JAVA_HOME<br>
export JAVA_HOME<br>
Line 77: Line 71:
Save your changes and exit
Save your changes and exit


== Step 12:<br> ==
== Step 11:<br> ==
Reload your system-wide PATH.
Reload your system-wide PATH.
<pre>$ . /etc/profile
<pre>$ . /etc/profile
</pre>
</pre>


== Step 13: Test your new installation. ==
== Step 12: Test your new installation. ==
<pre>$ java -version
<pre>$ java -version
</pre>
</pre>
Response:
Response:
java version "1.6.0_45"<br>
java version "1.7.0_79"<br>
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)<br>
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)<br>
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)<br>
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)<br>
<pre>$ javac -version
<pre>$ javac -version
</pre>
</pre>
Response:
Response:
javac 1.6.0_45
javac 1.7.0_79


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

Latest revision as of 12:32, 26 April 2015

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

This is a step-by-step installation instructions for 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 7 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: Create the installation folder

$ sudo mkdir -p /usr/lib/jvm

The –p option ensures that all folders in the mkdir path 1s created.

Step 2: Download Oracle Java

Download jre-7u79-linux-x64.tar.gz, jdk-7u79-linux-x64.tar.gz from:
http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

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

Typicly:

$ cd ~/Downloads

Step 4: Exctract images to the installation folder

$ sudo tar xvf jdk-7u79-linux-x64.tar.gz -C /usr/lib/jvm/
$ sudo tar xvf jre-7u79-linux-x64.tar.gz -C /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: Check your extracted folder names.

$ ls -l

Response: jdk1.7.0_79, jre1.7.0_79

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

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

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

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

Step 10: 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/usr/lib/jvm/jdk1.7.0_79/
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
Save your changes and exit

Step 11:

Reload your system-wide PATH.

$ . /etc/profile

Step 12: Test your new installation.

$ java -version

Response: java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

$ javac -version

Response: javac 1.7.0_79

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