Put an old JDK that is not supported on Ubuntu 16.04 Proxy environment not supported

Purpose

--Ubundle 16.04 currently supports two versions, JDK8 and JDK9, but here's how to get an older version of the JDK --This time, we will introduce JDK7 as an example.

Implementation outline

  1. Get the list for JDK 7 from the PPA repository
  2. Get a list of installable packages
  3. Get the main body of JDK7
  4. JDK version switching
  5. Check the version

Implementation details

  1. Get the list for JDK 7 from the PPA repository

  2. Execute the following command to get the list to install JDK7.

    ```terminal
    $ sudo add-apt-repository ppa:openjdk-r/ppa
    

・ ・ ・ >Reading package lists... Done ```

  1. Get a list of installable packages

  2. Execute the following command to get a list of installable packages.

    ```terminal
    $ sudo apt-get update
    

・ ・ ・ >Reading package lists... Done ```

  1. Get the main body of JDK7

  2. Execute the following command to get the main body of JDK.

    ```terminal
    $ sudo apt-get install openjdk-7-jdk
    ```
    
  3. Version switching

  4. If you have multiple JDK versions installed, switch the JDK version (if you see the output below, enter the number at the beginning of the line for the version of the JDK you want to change and enter, this time Enter 1 because you want to use JDK7 Enter)

    ```terminal
    $ sudo update-alternatives --config java
    >There are 2 choices for the alternative java (providing /usr/bin/java).
    >Selection    Path                                            Priority   Status
    >------------------------------------------------------------
    >* 0            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      auto mode
    >1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
    >2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
    >Press <enter> to keep the current choice[*], or type selection number: 
    ```
    
  5. Check the version

  6. Execute the following command to check the JDK version. (OK if it looks like the following)

    ```terminal
    $ java -version
    >java version "1.7.0_95"
    >OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-3)
    >OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
    ```
    

Recommended Posts

Put an old JDK that is not supported on Ubuntu 16.04 Proxy environment not supported
Proxy environment support for old JDKs not supported on Ubuntu 16.04
Build an Ubuntu python development environment on Google Cloud Platform
Put Python 3.x on Ubuntu
Solution when HDMI audio output is not possible on Ubuntu 20.04.1 LTS