How would you install Java 8u40+?

I’d like to use https://www.b4x.com/b4j.html to develop for my GameShell

I tested this with a fully upgraded system on my GameShell. Which Java 8 do you want?

Oracle Java JDK 8:

sudo apt update && sudo apt install software-properties-common
sudo add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
sudo apt update && sudo apt install oracle-java8-installer

Follow all instructions. Afterwards check:

$ javac -version
javac 1.8.0_181
$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)

OpenJDK 8

sudo apt update && sudo apt install default-jdk

Afterwards check:

$ javac -version
javac 1.8.0_181
$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1~deb9u1-b13)
OpenJDK Client VM (build 25.181-b13, mixed mode)

thank you, trying it now

sudo apt install oracle-java8-installer

Got me:

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘oracle-java8-installer’ has no installation candidate

My bad,

First add the repository, then update again before install.

It may be worth investigating if there are any just-in-time or ahead-of-time compilation options available that might be able to utilise native ARM assembler (at the sacrifice of portability) In my experience Java can be quite resource hungry.
On a relatively low resource machine such as the ClockworkPi, I wouldn’t expect real-time performance with the default vm

It seems the java guys messed up…

I guess they did. But that does not stop us:

sudo apt install dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886
sudo apt update && sudo apt install oracle-java8-installer

Assuming you have already added the repo.

That got it much further, I’m not getting the

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1~deb9u1-b13)
OpenJDK Client VM (build 25.181-b13, mixed mode)

stuff though (thank you for all the help by the way)

I suggest you only install 1 of the 2 (NOT BOTH!):

Oracle JDK 8 (oracle-java8-installer)
OR
OpenJDK 8 (default-jdk)

You can remove OpenJDK 8 for now:

sudo apt remove default-jdk
1 Like

Thank you. I hit another snag, this IDE also needs JavaFX. Is it even worth installing that? I’m worried already java will have low performance.

From what I read Oracle stopped JavaFX support for ARM since Java8u33+ (but you say you need Java8u40+).

Therefore the only thing I can think of is going back to OpenJDK 8 with OpenJavaFX:
sudo apt remove oracle-java8-installer
sudo apt update && sudo apt install default-jdk openjfx
java -version

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1~deb9u1-b13)
OpenJDK Client VM (build 25.181-b13, mixed mode)

cat /usr/share/java/openjfx/jre/lib/javafx.properties

javafx.runtime.version=8.0.141
javafx.runtime.build=b00

I have no experience with (the performance of) JavaFX or OpenJavaFX.

That worked. Thank you.

IMG_20180826_194357

1 Like

Hello, when I installed Oracle jdk, I reported the following error. What should I do?

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886

Then try again.

(However, I am not sure if the Java 8 package still exists.)

Even if you solve the “public key” problem above, the next error you might get is this one:

Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'oracle-java8-installer' has no installation candidate

That is because Oracle has changed their license:

The Oracle JDK License has changed for releases starting April 16, 2019.

The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost – but other uses authorized under prior Oracle JDK licenses may no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here.

Oracle Java downloads now require logging in to an Oracle account to download Java updates, like the latest Oracle Java 8u211 / Java SE 8u212. Because of this I cannot update the PPA with the latest Java (and the old links were broken by Oracle).

For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).

Which means you cannot install it through the PPA-repository anymore. You have to manually download Java8 from Oracle and install it manually. :confused:

Thank you. I downloaded the.tar.gz version of jdk8 from Oracle.But it can’t be used directly after decompression. Should I download the.rpm version?

The GameShell uses an ARM 32-bit processor, so pick the first one: Linux ARM 32 Hard Float ABI

After you put it on your GameShell extract it:

cpi@clockworkpi:~$ tar xzvf jdk-8u221-linux-arm32-vfp-hflt.tar.gz

Then you see you have the right version:

cpi@clockworkpi:~$ ~/jdk1.8.0_221/bin/java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) Client VM (build 25.221-b11, mixed mode)

Then do the basic Java stuff like setting your JAVA_HOME and expand your PATH.

And don’t forget to clear up your repositories removing all lines with http://ppa.launchpad.net/webup8team/java/ubuntu xenial:

Look for the lines in these files:
/etc/apt/sources.list
/etc/apt/sources.list.d/???

Then sudo apt update