How would you install Java 8u40+?


#1

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


#2

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)

#3

thank you, trying it now


#4

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


#5

My bad,

First add the repository, then update again before install.


#6

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


#7

It seems the java guys messed up…


#8

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.


#9

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)


#10

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

#12

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.


#13

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.


#14

That worked. Thank you.


#15