So I've tried about every guide I could find online, and they all end up going nowhere. They all seem to use the "webupd8team" method.
This really shouldn't be this hard. Is there some easier way to get this done, or is that just not something that can be done on the Raspberry Pi 3B+?
I'm open to any suggestions. Been at this for just over 4 hours, and I'm getting nowhere.
-
- Posts: 13
- Joined: Sat Dec 16, 2017 4:22 am
- Contact: YouTube
[SOLVED] How to update Java on Raspbian
Last edited by M1dn1ghtN1nj4 on Thu Jan 17, 2019 6:10 pm, edited 1 time in total.
Re: How to update Java on Raspbian
Can't remember where I got this from on google, but this worked (for jdk-8u192) - change version number accordingly:
Download the JDK directly from Oracle’s website. Since Raspberry Pi is powered by ARM processor and Raspbian is a 32-bit OS, choose the Linux ARM 32 Hard Float ABI version.
When you have downloaded the right package, unpack it into /usr/java directory:
sudo mkdir /usr/java
cd /usr/java
sudo tar xf ~/jdk-8u111-linux-arm32-vfp-hflt.tar.gz
You can then create symbolic links in /usr/bin folder (so you’ll be able to use java command anywhere) by adding the following alternatives:
sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_111/bin/java 1000
sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_111/bin/javac 1000
At this point, you should be able to verify that your Java installation works by running the following command:
java -version.
Download the JDK directly from Oracle’s website. Since Raspberry Pi is powered by ARM processor and Raspbian is a 32-bit OS, choose the Linux ARM 32 Hard Float ABI version.
When you have downloaded the right package, unpack it into /usr/java directory:
sudo mkdir /usr/java
cd /usr/java
sudo tar xf ~/jdk-8u111-linux-arm32-vfp-hflt.tar.gz
You can then create symbolic links in /usr/bin folder (so you’ll be able to use java command anywhere) by adding the following alternatives:
sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_111/bin/java 1000
sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_111/bin/javac 1000
At this point, you should be able to verify that your Java installation works by running the following command:
java -version.
-
- Posts: 13
- Joined: Sat Dec 16, 2017 4:22 am
- Contact: YouTube
Re: How to update Java on Raspbian
That's perfect! I never found a method like this, although I suspected it was something that was straight forward. Just seemed that EVERYBODY had trouble with it, hence why webupd8team stepped in. Here is the command list I used to get up and running on 8u202:
Code: Select all
sudo mkdir /usr/java
cd /usr/java
sudo tar xf ~/jdk-8u202-linux-arm32-vfp-hflt.tar.gz
sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_202/bin/java 1000
sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_202/bin/javac 1000
java -version ; javac -version
Code: Select all
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) Client VM (build 25.202-b08, mixed mode)
javac 1.8.0_202
Re: [SOLVED] How to update Java on Raspbian
I am happy it got you running - now I need to get 202!
- RaspianKing
- Posts: 6
- Joined: Mon Mar 04, 2019 9:31 pm
Re: [SOLVED] How to update Java on Raspbian
Hey, I installed Raspbian using NOOBS Lite, does it already have java 8?
If not, how can I install it? I need it badly for a project.

If not, how can I install it? I need it badly for a project.

I am the king of the unknown operating system called "Raspian" (not Raspbian)
LOL. I am a total
geek.


Re: [SOLVED] How to update Java on Raspbian
Which version of raspbian did you get? Oracle Java 7 and 8 have been dropped in Buster in favour of openJDK 11 (nice one).
- RaspianKing
- Posts: 6
- Joined: Mon Mar 04, 2019 9:31 pm
Re: [SOLVED] How to update Java on Raspbian
I'm not sure, just the Raspbian recommended by NOOBS.
But how can I install and older version?

But how can I install and older version?

I am the king of the unknown operating system called "Raspian" (not Raspbian)
LOL. I am a total
geek.


Re: [SOLVED] How to update Java on Raspbian
Ok latest NOOBS will be Raspbian “Buster”.
Does the download java from Oracle as per instructions above work for you?
Does the download java from Oracle as per instructions above work for you?
-
- Posts: 25726
- Joined: Tue Mar 25, 2014 12:40 pm
- Location: Delightful Dorset
Re: [SOLVED] How to update Java on Raspbian
The information is out there....you just have to let it in.
My other Linux machines are a ChromeBox & Intel CoreDuo Desktop
My other Linux machines are a ChromeBox & Intel CoreDuo Desktop
-
- Posts: 6
- Joined: Mon Mar 17, 2014 4:55 am
Re: [SOLVED] How to update Java on Raspbian
Not sure why, but after following above instructions the link created still pointed to openjdk11. I used the command:
I then repeated the link creation and all works as it should. I hope someone far more familiar with what protections were in place could provide clarification. Maybe even a better way to fix this.
This was done on a Raspberry Pi 4 w/1Gb
Code: Select all
sudo update-alternatives --remove-all java
sudo update-alternatives --remove-all javac
This was done on a Raspberry Pi 4 w/1Gb