Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save pilinux/0299d1412ee1745a28b8364644ceef0e to your computer and use it in GitHub Desktop.

Select an option

Save pilinux/0299d1412ee1745a28b8364644ceef0e to your computer and use it in GitHub Desktop.

Revisions

  1. pilinux revised this gist Jul 9, 2018. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions how-to-install-java-on-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -62,11 +62,10 @@ sudo apt-get install oracle-java8-installer
    5. Verify that we have successfully installed java

    ```bash
    pi@raspberrypi:~# java -version
    java version "1.8.0_161"
    Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
    Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode)

    pi@raspberrypi:~ $ java -version
    java version "1.8.0_171"
    Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
    Java HotSpot(TM) Client VM (build 25.171-b11, mixed mode)
    ```

    # Switching between versions
  2. pilinux revised this gist Jul 9, 2018. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions how-to-install-java-on-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -37,10 +37,17 @@ sudo apt-key add key.txt

    3. Add the repository to `/etc/apt/sources.list.d/` and perform an update

    ```bash
    echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
    echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
    ```
    sudo nano /etc/apt/sources.list.d/webupd8team-java.list
    ```

    add the following repository

    ```
    deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
    deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
    ```
    update source-list

    ```bash
    sudo apt-get update
  3. Rafael Ibasco revised this gist Feb 12, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion how-to-install-java-on-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -88,4 +88,4 @@ update-java-alternatives -s java-8-oracle
    ```bash
    sudo apt-get install oracle-java8-set-default
    ```
    [More details here] (https://ribasco.wordpress.com/2018/02/11/how-to-install-the-latest-java-version-in-raspbian-stretch/)
    [More details here](https://ribasco.wordpress.com/2018/02/11/how-to-install-the-latest-java-version-in-raspbian-stretch/)
  4. Rafael Ibasco revised this gist Feb 12, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion how-to-install-java-on-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -88,4 +88,4 @@ update-java-alternatives -s java-8-oracle
    ```bash
    sudo apt-get install oracle-java8-set-default
    ```
    [https://ribasco.wordpress.com/2018/02/11/how-to-install-the-latest-java-version-in-raspbian-stretch/] See
    [More details here] (https://ribasco.wordpress.com/2018/02/11/how-to-install-the-latest-java-version-in-raspbian-stretch/)
  5. Rafael Ibasco revised this gist Feb 12, 2018. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions how-to-install-java-on-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -88,5 +88,4 @@ update-java-alternatives -s java-8-oracle
    ```bash
    sudo apt-get install oracle-java8-set-default
    ```


    [https://ribasco.wordpress.com/2018/02/11/how-to-install-the-latest-java-version-in-raspbian-stretch/] See
  6. Rafael Ibasco renamed this gist Feb 11, 2018. 1 changed file with 0 additions and 0 deletions.
  7. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -72,7 +72,7 @@ If you have multiple jvms installed and you want to switch back to a specific ve
    ```bash
    update-java-alternatives -l
    ```
    2. Copy the key of the first column of the result
    2. Copy the key of the first column of the result of your target version
    ```bash
    java-8-oracle 1081 /usr/lib/jvm/java-8-oracle
    ```
  8. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -68,7 +68,7 @@ If you have multiple jvms installed and you want to switch back to a specific ve

    #### Option 1

    1. First list the available versions in your system
    1. List the available versions in your system
    ```bash
    update-java-alternatives -l
    ```
  9. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 24 additions and 3 deletions.
    27 changes: 24 additions & 3 deletions how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -62,10 +62,31 @@ Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode)

    ```

    Other tips:
    # Switching between versions

    If you have multiple jvm versions installed and you want to switch back to java 8, you can do
    If you have multiple jvms installed and you want to switch back to a specific version of java you can do the following:

    #### Option 1

    1. First list the available versions in your system
    ```bash
    update-java-alternatives -l
    ```
    2. Copy the key of the first column of the result
    ```bash
    java-8-oracle 1081 /usr/lib/jvm/java-8-oracle
    ```

    3. Execute the set command using the previously copied key

    ```bash
    update-java-alternatives -s java-8-oracle
    ```

    #### Option 2

    ```bash
    sudo apt-get install oracle-java8-set-default
    ```
    ```


  10. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -60,4 +60,12 @@ java version "1.8.0_161"
    Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
    Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode)

    ```

    Other tips:

    If you have multiple jvm versions installed and you want to switch back to java 8, you can do

    ```
    sudo apt-get install oracle-java8-set-default
    ```
  11. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -52,4 +52,12 @@ sudo apt-get update
    sudo apt-get install oracle-java8-installer
    ```

    5. Verify that we have successfully installed java

    ```bash
    pi@raspberrypi:~# java -version
    java version "1.8.0_161"
    Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
    Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode)

    ```
  12. Rafael Ibasco revised this gist Feb 11, 2018. No changes.
  13. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ sudo apt-key add key.txt
    ```


    3. Add the repository and perform an update
    3. Add the repository to `/etc/apt/sources.list.d/` and perform an update

    ```bash
    echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
  14. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ The default version of java provided in the latest raspbian images are outdated,

    # Installation

    1. **Step 1:** Create the gpg key file and paste the following lines of text below
    1. Create the gpg key file and paste the following lines of text below

    ```
    nano key.txt
    @@ -28,14 +28,14 @@ xTdyLkFCrbbIAZEHtmjXRgQu3VUcSkgHMdn46j/7N9qtZUcXQ0TOsZUJRANY/eHsBvUg1cBm
    -----END PGP PUBLIC KEY BLOCK-----
    ```
    2. ** Step 2:** Add the gpg key
    2. Add the gpg key

    ```
    sudo apt-key add key.txt
    ```


    3. **Step 3:** Add the repository and perform an update
    3. Add the repository and perform an update

    ```bash
    echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
    @@ -46,7 +46,7 @@ echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | te
    sudo apt-get update
    ```

    4. **Step 4: ** Install Java 8 SDK
    4. Install Java 8 SDK

    ```bash
    sudo apt-get install oracle-java8-installer
  15. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 48 additions and 2 deletions.
    50 changes: 48 additions & 2 deletions how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,55 @@
    # Introduction

    The default version of java provided in the latest raspbian images are outdated, so we are going to install from the *ppa:webupd8team/java* repository instead.
    The default version of java provided in the latest raspbian images are outdated, so we are going to install from the `ppa:webupd8team/java` repository instead. Please note that `add-apt-repository ppa:webupd8team/java` will not work, so we will need to add the repository manually.

    # Installation

    Add the *ppa:webupd8team/java* repository manually (since `add-apt-repository ppa:webupd8team/java` will not work)
    1. **Step 1:** Create the gpg key file and paste the following lines of text below

    ```
    nano key.txt
    ```
    ```
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: SKS 1.1.5
    Comment: Hostname: keyserver.ubuntu.com
    mI0ES9/P3AEEAPbI+9BwCbJucuC78iUeOPKl/HjAXGV49FGat0PcwfDd69MVp6zUtIMbLgkU
    OxIlhiEkDmlYkwWVS8qy276hNg9YKZP37ut5+GPObuS6ZWLpwwNus5PhLvqeGawVJ/obu7d7
    gM8mBWTgvk0ErnZDaqaU2OZtHataxbdeW8qH/9FJABEBAAG0DUxhdW5jaHBhZCBWTEOImwQQ
    AQIABgUCVsN4HQAKCRAEC6TrO3+B2tJkA/jM3b7OysTwptY7P75sOnIu+nXLPlzvja7qH7Wn
    A23itdSker6JmyJrlQeQZu7b9x2nFeskNYlnhCp9mUGu/kbAKOx246pBtlaipkZdGmL4qXBi
    +bi6+5Rw2AGgKndhXdEjMxx6aDPq3dftFXS68HyBM3HFSJlf7SmMeJCkhNRwiLYEEwECACAF
    Akvfz9wCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRDCUYJI7qFIhucGBADQnY4V1xKT
    1Gz+3ERly+nBb61BSqRx6KUgvTSEPasSVZVCtjY5MwghYU8T0h1PCx2qSir4nt3vpZL1luW2
    xTdyLkFCrbbIAZEHtmjXRgQu3VUcSkgHMdn46j/7N9qtZUcXQ0TOsZUJRANY/eHsBvUg1cBm
    3RnCeN4C8QZrir1CeA==
    =CziK
    -----END PGP PUBLIC KEY BLOCK-----
    ```
    2. ** Step 2:** Add the gpg key

    ```
    sudo apt-key add key.txt
    ```


    3. **Step 3:** Add the repository and perform an update

    ```bash
    echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
    echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
    ```

    ```bash
    sudo apt-get update
    ```

    4. **Step 4: ** Install Java 8 SDK

    ```bash
    sudo apt-get install oracle-java8-installer
    ```


  16. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -2,3 +2,8 @@

    The default version of java provided in the latest raspbian images are outdated, so we are going to install from the *ppa:webupd8team/java* repository instead.

    # Installation

    Add the *ppa:webupd8team/java* repository manually (since `add-apt-repository ppa:webupd8team/java` will not work)


  17. Rafael Ibasco revised this gist Feb 11, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion how-to-install-java-raspbian.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Introduction

    The default version of java provided in the latest raspbian images are outdated, so we are going to install from the ppa:webupd8team/java repository.
    The default version of java provided in the latest raspbian images are outdated, so we are going to install from the *ppa:webupd8team/java* repository instead.

  18. Rafael Ibasco renamed this gist Feb 11, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  19. Rafael Ibasco created this gist Feb 11, 2018.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # Introduction

    The default version of java provided in the latest raspbian images are outdated, so we are going to install from the ppa:webupd8team/java repository.