How To Install IBM Java 7 on Ubuntu 16.04

Overview

In this tutorial we’ll learn how-to install IBM java 7 and IBM Java 7 Update 1 on Ubuntu 16.04 (Xenial Xerus).

IBM Java or IBM SDK, Java Technology Edition Version 7 is a Java Development Kit provided by IBM that is compatible with Oracle Java 7.

We can Download the latest version of IBM Java SDK from [IBM Java SDK download page][1].

At the time of this writing the latest version of IBM java released is 7.0.10.10. There are two types of IBM Java available, JDK or Java Development Kit and JRE or Java Runtime Environment. If you only need to run Java Application you can install JRE but if you want to develop Java application or need to compile Java source code you will need JDK installed.

IBM provides two kinds of installer one that require root access and the other one doesn’t require root. We’ll learn to install both JDK and JRE using both installer type

Install IBM Java 7 JDK and JRE without root privileges

In this section we’ll install IBM Java 7 JDK

Install IBM Java 7 JDK without root privileges

First of all let’s download the installer using wget


$ <span class="token function">wget</span> -c http://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.0.10.10/linux/x86_64/ibm-java-sdk-7.0-10.10-x86_64-archive.bin

```

Now extract the downloaded file by running command below.


$ ./ibm-java-sdk-7.0-10.10-x86_64-archive.bin

```

If you get permission denied error message like output below we need to change file permission.


-bash: ./ibm-java-sdk-7.0-10.10-x86_64-archive.bin: Permission denied

```

Change permission of this file using command below.


$ <span class="token function">chmod</span> 700 ibm-java-sdk-7.0-10.10-x86_64-archive.bin

```

Re-run the installer. First step of the installation is to choose locale. We will use English for this tutorial so I'll just press ENTER.

[Install IBM Java 7 Ubuntu 16.04][2]

Next step is license agreement. Input **1** to accept and press ENTER

[Install IBM Java 7 Ubuntu 16.04][3]

Installation wizard start. Press ENTER to continue.

[Install IBM Java 7 Ubuntu 16.04][4]

We will use default installation location where the package will be extracted to home directory.

[Install IBM Java 7 Ubuntu 16.04][5]

Pre installation summary. Press ENTER.

[][6]

Installation complete. Press ENTER.

[][7]

IBM JDK 7 successfully installed on our home directory. Let's check installed version using command below.


$ ibm-java-x86_64-70/bin/java -version
java version <span class="token string">"1.7.0"</span>
Java<span class="token punctuation">(</span>TM<span class="token punctuation">)</span> SE Runtime Environment <span class="token punctuation">(</span>build pxa6470sr10fp10-20170726_05<span class="token punctuation">(</span>SR10 FP10<span class="token punctuation">))</span>
IBM J9 VM <span class="token punctuation">(</span>build 2.6, JRE 1.7.0 Linux amd64-64 Compressed References 20170718_357001 <span class="token punctuation">(</span>JIT enabled, AOT enabled<span class="token punctuation">)</span>
J9VM - R26_Java726_SR10_20170718_1208_B357001
JIT  - r11_20170718_357001
GC   - R26_Java726_SR10_20170718_1208_B357001_CMPRSS
J9CL - 20170718_357001<span class="token punctuation">)</span>
JCL - 20170725_01 based on Oracle jdk7u151-b14

```

### Install IBM Java 7 JRE without root privileges

Now we'll learn how to install IBM Java 7 JRE without root privileges.

Download IBM Java JRE 7 installed using wget.


$ <span class="token function">wget</span> -c http://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.0.10.10/linux/x86_64/ibm-java-jre-7.0-10.10-x86_64-archive.bin

```

Change the file permission so we can execute or run the file.


$ <span class="token function">chmod</span> 700 ibm-java-jre-7.0-10.10-x86_64-archive.bin

```

Run the installer using command below


$ ./ibm-java-jre-7.0-10.10-x86_64-archive.bin

```

First step of the installer is to choose language. We will use English so we can just press **ENTER**.


Preparing to install<span class="token punctuation">..</span>.
Extracting the JRE from the installer archive<span class="token punctuation">..</span>.
Unpacking the JRE<span class="token punctuation">..</span>.
Extracting the installation resources from the installer archive<span class="token punctuation">..</span>.
Configuring the installer <span class="token keyword">for</span> this system's environment<span class="token punctuation">..</span>.

Launching installer<span class="token punctuation">..</span>.


Graphical installers are not supported by the VM. The console mode will be used instead<span class="token punctuation">..</span>.

<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Choose Locale<span class="token punctuation">..</span>.
----------------

    1- Bahasa Indonesia
    2- Català
    3- Deutsch
  -<span class="token operator">></span>4- English
    5- Español
    6- Français
    7- Italiano
    8- Português

CHOOSE LOCALE BY NUMBER:

```

Next step is license agreement. Choose **1** to accept the license.


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
IBM 64-bit Linux Runtime <span class="token keyword">for</span> Java v7             <span class="token punctuation">(</span>created with InstallAnywhere<span class="token punctuation">)</span>
-------------------------------------------------------------------------------

Preparing CONSOLE Mode Installation<span class="token punctuation">..</span>.




<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>


 
 
    International License Agreement <span class="token keyword">for</span> Non-Warranted Programs
    
    Part 1 - General Terms
    
    BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON AN
    <span class="token string">"ACCEPT"</span> BUTTON, OR OTHERWISE USING THE PROGRAM, LICENSEE AGREES TO
    THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCEPTING THESE TERMS ON
    BEHALF OF LICENSEE, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL
    AUTHORITY TO BIND LICENSEE TO THESE TERMS. IF YOU DO NOT AGREE TO
    THESE TERMS,
    
    * DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK ON AN <span class="token string">"ACCEPT"</span> BUTTON,
    OR USE THE PROGRAM<span class="token punctuation">;</span> AND
    
    * PROMPTLY RETURN THE UNUSED MEDIA AND DOCUMENTATION TO THE PARTY FROM
    WHOM IT WAS OBTAINED FOR A REFUND OF THE AMOUNT PAID. IF THE PROGRAM
    WAS DOWNLOADED, DESTROY ALL COPIES OF THE PROGRAM.
    
    1. Definitions
 
Press Enter to <span class="token keyword">continue</span> viewing the license agreement, or enter <span class="token string">"1"</span> to 
   accept the agreement, <span class="token string">"2"</span> to decline it, <span class="token string">"3"</span> to print it, or <span class="token string">"99"</span> to go back
   to the previous screen.: 1

```

press **ENTER** to continue the installation process.


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Introduction
------------

InstallAnywhere will guide you through the installation of IBM 64-bit Linux 
Runtime <span class="token keyword">for</span> Java v7.

It is strongly recommended that you quit all programs before continuing with 
this installation.

Respond to each prompt to proceed to the next step <span class="token keyword">in</span> the installation.  If you
want to change something on a previous step, <span class="token function">type</span> <span class="token string">'back'</span><span class="token keyword">.</span>

You may cancel this installation at any <span class="token function">time</span> by typing <span class="token string">'quit'</span><span class="token keyword">.</span>

PRESS  TO CONTINUE:

```

Choose JRE installation folder. Input `/home/ubuntu/jre/ibm-java-x86_64-70`.


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Choose Install Folder
---------------------

Where would you like to install?

  Default Install Folder: /home/ubuntu/ibm-java-x86_64-70

ENTER AN ABSOLUTE PATH, OR PRESS  TO ACCEPT THE DEFAULT
      <span class="token keyword">:</span> /home/ubuntu/jre/ibm-java-x86_64-70        

INSTALL FOLDER IS: /home/ubuntu/jre/ibm-java-x86_64-70
   IS THIS CORRECT? <span class="token punctuation">(</span>Y/N<span class="token punctuation">)</span>: Y

```

Pre installation summary, press **ENTER** to start installing JRE.


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Pre-Installation Summary
------------------------

Please Review the Following Before Continuing:

Product Name:
    IBM 64-bit Linux Runtime <span class="token keyword">for</span> Java v7

Install Folder:
    /home/ubuntu/jre/ibm-java-x86_64-70

Disk Space Information <span class="token punctuation">(</span>for Installation Target<span class="token punctuation">)</span>: 
    Required:  165,394,416 bytes
    Available: 7,696,896,000 bytes

PRESS  TO CONTINUE:

```

Installation complete. Press **ENTER** to finish the installation process.


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Installing<span class="token punctuation">..</span>.
-------------

 <span class="token punctuation">[</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token punctuation">]</span>
 <span class="token punctuation">[</span>------------------<span class="token operator">|</span>------------------<span class="token operator">|</span>------------------<span class="token operator">|</span>------------------<span class="token punctuation">]</span>



<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Installation Complete
---------------------

Congratulations. IBM 64-bit Linux Runtime <span class="token keyword">for</span> Java v7 has been successfully 
installed to:

   /home/ubuntu/jre/ibm-java-x86_64-70

PRESS  TO EXIT THE INSTALLER: 

```

### Testing JDK and JRE installed on home directory

Now we have JDK and JRE installed on our home directory. Let's test our installation by creating a Java application, compile the application and the run the resulting bytecode.

Create new file called `hellohowtodojo.java` with contents below.


<span class="token keyword">class</span> hellohowtodojo <span class="token punctuation">{</span>
    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">System</span><span class="token punctuation">.</span>out<span class="token punctuation">.</span><span class="token function">println</span><span class="token punctuation">(</span><span class="token string">"Hello IBM Java 7 from HowtoDojo!"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>

```

Compile the java code above using `javac` binary installed in our home directory.


$ ibm-java-x86_64-70/bin/javac hellohowtodojo.java 

```

The process above will create new bytecode file called `hellohowtodojo.class`.

We can run this application using `java` installed on IBM JDK.


$ ibm-java-x86_64-70/bin/java hellohowtodojo
Hello IBM Java 7 from HowtoDojo<span class="token operator">!</span>

```

We can also run the same application using `java` program installed by JRE packages.


$ jre/ibm-java-x86_64-70/jre/bin/java hellohowtodojo
Hello IBM Java 7 from HowtoDojo<span class="token operator">!</span>

```

## Install IBM Java 7 JDK and JRE with root privileges

In this section we'll install IBM JDK 7 and JRE 7 using installer that require root privileges.

### Install IBM Java 7 JDK with root privileges

Download IBM Java 7 JDK installer using wget.


$ <span class="token function">wget</span> -c http://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.0.10.10/linux/x86_64/ibm-java-x86_64-sdk-7.0-10.10.bin

```

Change installer file permission so we can execute the installer file.


$ <span class="token function">chmod</span> 700 ibm-java-x86_64-sdk-7.0-10.10.bin

```

Run IBM JDK installer using command below


$ <span class="token function">sudo</span> ./ibm-java-x86_64-sdk-7.0-10.10.bin

```

Since we will use English language press **ENTER** for the first step


Preparing to install<span class="token punctuation">..</span>.
Extracting the JRE from the installer archive<span class="token punctuation">..</span>.
Unpacking the JRE<span class="token punctuation">..</span>.
Extracting the installation resources from the installer archive<span class="token punctuation">..</span>.
Configuring the installer <span class="token keyword">for</span> this system's environment<span class="token punctuation">..</span>.

Launching installer<span class="token punctuation">..</span>.


Graphical installers are not supported by the VM. The console mode will be used instead<span class="token punctuation">..</span>.

<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Choose Locale<span class="token punctuation">..</span>.
----------------

    1- Bahasa Indonesia
    2- Català
    3- Deutsch
    -<span class="token operator">></span>4- English
    5- Español
    6- Français
    7- Italiano
    8- Português

CHOOSE LOCALE BY NUMBER:

```

Read the license agreement, input **1** to accept and press ENTER


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
IBM 64-bit Linux SDK <span class="token keyword">for</span> Java v7                 <span class="token punctuation">(</span>created with InstallAnywhere<span class="token punctuation">)</span>
-------------------------------------------------------------------------------

Preparing CONSOLE Mode Installation<span class="token punctuation">..</span>.




<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>


    
    
    International License Agreement <span class="token keyword">for</span> Non-Warranted Programs
    
    Part 1 - General Terms
    
    BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON AN
    <span class="token string">"ACCEPT"</span> BUTTON, OR OTHERWISE USING THE PROGRAM, LICENSEE AGREES TO
    THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCEPTING THESE TERMS ON
    BEHALF OF LICENSEE, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL
    AUTHORITY TO BIND LICENSEE TO THESE TERMS. IF YOU DO NOT AGREE TO
    THESE TERMS,
    
    * DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK ON AN <span class="token string">"ACCEPT"</span> BUTTON,
    OR USE THE PROGRAM<span class="token punctuation">;</span> AND
    
    * PROMPTLY RETURN THE UNUSED MEDIA AND DOCUMENTATION TO THE PARTY FROM
    WHOM IT WAS OBTAINED FOR A REFUND OF THE AMOUNT PAID. IF THE PROGRAM
    WAS DOWNLOADED, DESTROY ALL COPIES OF THE PROGRAM.
    
    1. Definitions
    
Press Enter to <span class="token keyword">continue</span> viewing the license agreement, or enter <span class="token string">"1"</span> to 
    accept the agreement, <span class="token string">"2"</span> to decline it, <span class="token string">"3"</span> to print it, or <span class="token string">"99"</span> to go back
    to the previous screen.: 1

```

Press ENTER to continue the installation process


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Introduction
------------

InstallAnywhere will guide you through the installation of IBM 64-bit Linux SDK
<span class="token keyword">for</span> Java v7.

It is strongly recommended that you quit all programs before continuing with 
this installation.

Respond to each prompt to proceed to the next step <span class="token keyword">in</span> the installation.  If you
want to change something on a previous step, <span class="token function">type</span> <span class="token string">'back'</span><span class="token keyword">.</span>

You may cancel this installation at any <span class="token function">time</span> by typing <span class="token string">'quit'</span><span class="token keyword">.</span>

PRESS  TO CONTINUE: 

```

Choose installation directory, input `/opt/ibm/java-x86_64-70-jdk`


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Choose Install Folder
---------------------

Where would you like to install?

    Default Install Folder: /opt/ibm/java-x86_64-70

ENTER AN ABSOLUTE PATH, OR PRESS  TO ACCEPT THE DEFAULT
        <span class="token keyword">:</span> /opt/ibm/java-x86_64-70-jdk

INSTALL FOLDER IS: /opt/ibm/java-x86_64-70-jdk
    IS THIS CORRECT? <span class="token punctuation">(</span>Y/N<span class="token punctuation">)</span>: Y

```

Pre instalation summary, press ENTER to continue


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Pre-Installation Summary
------------------------

Please Review the Following Before Continuing:

Product Name:
    IBM 64-bit Linux SDK <span class="token keyword">for</span> Java v7

Install Folder:
    /opt/ibm/java-x86_64-70-jdk

Disk Space Information <span class="token punctuation">(</span>for Installation Target<span class="token punctuation">)</span>: 
    Required:  214,283,158 bytes
    Available: 4,712,919,040 bytes

PRESS  TO CONTINUE: 

```

Installation process start


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Installing<span class="token punctuation">..</span>.
-------------

    <span class="token punctuation">[</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">|</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token punctuation">]</span>
    <span class="token punctuation">[</span>------------------<span class="token operator">|</span>------------------<span class="token operator">|</span>------------------<span class="token operator">|</span>------------------<span class="token punctuation">]</span>


```

IBM Java 7 JDK installation process finished.


<span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">==</span><span class="token operator">=</span>
Installation Complete
---------------------

Congratulations. IBM 64-bit Linux SDK <span class="token keyword">for</span> Java v7 has been successfully 
installed to:

    /opt/ibm/java-x86_64-70-jdk

PRESS  TO EXIT THE INSTALLER:

```

We need to add java and javac command using update-alternatives so we can easily use IBM JDK 7 without specifying full path

Install java command using update-alternatives using command below


$ <span class="token function">sudo</span> update-alternatives --install /usr/bin/java java /opt/ibm/java-x86_64-70-jdk/bin/java 1000
update-alternatives: using /opt/ibm/java-x86_64-70-jdk/bin/java to provide /usr/bin/java <span class="token punctuation">(</span>java<span class="token punctuation">)</span> <span class="token keyword">in</span> auto mode

```

When we list java alternatives we saw IBM Java 7 JDK listed.


$ <span class="token function">sudo</span> update-alternatives --list java
/opt/ibm/java-x86_64-70-jdk/bin/java

```

Install javac command using command below


$ <span class="token function">sudo</span> update-alternatives --install /usr/bin/javac javac /opt/ibm/java-x86_64-70-jdk/bin/javac 1000
update-alternatives: using /opt/ibm/java-x86_64-70-jdk/bin/javac to provide /usr/bin/javac <span class="token punctuation">(</span>javac<span class="token punctuation">)</span> <span class="token keyword">in</span> auto mode

```

We can also verify that javac already listed


$ <span class="token function">sudo</span> update-alternatives --list javac
/opt/ibm/java-x86_64-70-jdk/bin/javac

```

We can also check java and javac command using `which` command


$ <span class="token function">which</span> java
/usr/bin/java

$ <span class="token function">which</span> javac
/usr/bin/javac

```

### Uninstall IBM JDK 7

In this section we'll learn how to uninstall IBM JDK 7 installed with root privileges.

We can run the same command to uninstall IBM JDK 7 using IBM JDK 7 installer.


$ <span class="token function">sudo</span> ./ibm-java-x86_64-sdk-7.0-10.10.bin

```

### Install IBM Java 7 JRE with root privileges

In this section we'll learn how to install IBM Java 7 JRE. Instead of using wizard we'll do silent install by providing properties file to the installer.

Download IBM Java 7 JRE installer using wget.


$ <span class="token function">wget</span> -c http://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/7.0.10.10/linux/x86_64/ibm-java-x86_64-jre-7.0-10.10.bin

```

Change installer file permission so we can execute the JRE installer.


$ <span class="token function">chmod</span> 700 ibm-java-x86_64-jre-7.0-10.10.bin 

```

Create new file called `install.properties` with contents below


<span class="token constant">INSTALLER_UI</span><span class="token attr-value"><span class="token punctuation">=</span>silent </span>
<span class="token constant">USER_INSTALL_DIR</span><span class="token attr-value"><span class="token punctuation">=</span>/opt/ibm/java-x86_64-70-jre</span>
<span class="token constant">LICENSE_ACCEPTED</span><span class="token attr-value"><span class="token punctuation">=</span>TRUE</span>

```

Run IBM JRE 7 installer using command below


$ ./ibm-java-x86_64-jre-7.0-10.10.bin 

```

or you can also specify the properties file to the installer


$ ./ibm-java-x86_64-jre-7.0-10.10.bin -f install.properties

```

## Summary

In this tutorial we learned how to install IBM Java 7 on Ubuntu 16.04, both JDK and JRE.

We learned to use installer that require root privilege and also installer that doesn't require root privileges.

We also learned how to do silent install of IBM Java 7. Silent install can be used to automate installation process of IBM Java on servers.

 [1]: https://developer.ibm.com/javasdk/downloads/
 [2]: https://www.howtodojo.com/wp-content/uploads/2017/09/install-IBM-java-7-ubuntu-16.04-01.png
 [3]: https://www.howtodojo.com/wp-content/uploads/2017/09/install-IBM-java-7-ubuntu-16.04-02.png
 [4]: https://www.howtodojo.com/wp-content/uploads/2017/09/install-IBM-java-7-ubuntu-16.04-03.png
 [5]: https://www.howtodojo.com/wp-content/uploads/2017/09/install-IBM-java-7-ubuntu-16.04-04.png
 [6]: https://www.howtodojo.com/wp-content/uploads/2017/09/install-IBM-java-7-ubuntu-16.04-05.png
 [7]: https://www.howtodojo.com/wp-content/uploads/2017/09/install-IBM-java-7-ubuntu-16.04-06.png