# How would you install Java 8u40+?

**URL:** <https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465>\
**Category:** Developers\
**Created:** [August 23, 2018, 6:37pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465 "2018-08-23T18:37:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 23, 2018, 6:37pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/1 "2018-08-23T18:37:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 23, 2018, 9:41pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/2 "2018-08-23T21:41:56Z")

</div>

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

**Oracle Java JDK 8:**

```auto
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:

```auto
$ 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**

```auto
sudo apt update && sudo apt install default-jdk

```

Afterwards check:

```auto
$ 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)

```

---

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 24, 2018, 7:50pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/3 "2018-08-24T19:50:21Z")

</div>

thank you, trying it now

---

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 24, 2018, 8:02pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/4 "2018-08-24T20:02:06Z")

</div>

> `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

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 25, 2018, 1:31am UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/5 "2018-08-25T01:31:54Z")

</div>

My bad,

First add the repository, then update again before install.

---

<div class="post-metadata">

**Author:** ![R37R0](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/r37r0/32/11_2.png) [@R37R0](https://forum.clockworkpi.com/u/R37R0)\
**Post date:** [August 25, 2018, 7:24am UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/6 "2018-08-25T07:24:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 25, 2018, 4:12pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/7 "2018-08-25T16:12:07Z")

</div>

> [@Oet](#):
>
> cpi@clockworkpi:~$ sudo apt update && sudo apt install software-properties-commo n  
> Get:1 [Index of /debian-security](http://security.debian.org/debian-security) stretch/updates InRelease [94.3 kB]  
> Get:2 [Index of /webupd8team/java/ubuntu](http://ppa.launchpad.net/webupd8team/java/ubuntu) xenial InRelease [17.5 kB]  
> Ign:3 [Index of /debian](http://debian-mirror.sakura.ne.jp/debian) stretch InRelease  
> Get:4 [Index of /debian](http://debian-mirror.sakura.ne.jp/debian) stretch-updates InRelease [91.0 k B]  
> Hit:5 [Index of /debian](http://debian-mirror.sakura.ne.jp/debian) stretch Release  
> Err:2 [Index of /webupd8team/java/ubuntu](http://ppa.launchpad.net/webupd8team/java/ubuntu) xenial InRelease  
> The following signatures couldn’t be verified because the public key is not av ailable: NO\_PUBKEY C2518248EEA14886  
> Reading package lists… Done  
> W: GPG error: [Index of /webupd8team/java/ubuntu](http://ppa.launchpad.net/webupd8team/java/ubuntu) xenial InRelease: The following signatures couldn’t be verified because the public key is not ava ilable: NO\_PUBKEY C2518248EEA14886  
> E: The repository ‘[Index of /webupd8team/java/ubuntu](http://ppa.launchpad.net/webupd8team/java/ubuntu) xenial InRel ease’ is not signed.  
> N: Updating from such a repository can’t be done securely, and is therefore disa bled by default.  
> N: See apt-secure(8) manpage for repository creation and user configuration deta ils.

It seems the java guys messed up…

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 25, 2018, 4:29pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/8 "2018-08-25T16:29:25Z")

</div>

> [@TechniMyoko](#):
>
> It seems the java guys messed up…

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 25, 2018, 5:03pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/9 "2018-08-25T17:03:01Z")

</div>

> [@Oet](#):
>
> cpi@clockworkpi:~$ javac -version  
> javac 1.8.0\_181  
> cpi@clockworkpi:~$ java -version  
> java version “1.8.0\_181”  
> Java™ SE Runtime Environment (build 1.8.0\_181-b13)  
> Java HotSpot™ Client VM (build 25.181-b13, mixed mode)  
> cpi@clockworkpi:~$ sudo apt update && sudo apt install default-jdk  
> Hit:1 [Index of /debian-security](http://security.debian.org/debian-security) stretch/updates InRelease  
> Hit:2 [Index of /webupd8team/java/ubuntu](http://ppa.launchpad.net/webupd8team/java/ubuntu) xenial InRelease  
> Ign:3 [Index of /debian](http://debian-mirror.sakura.ne.jp/debian) stretch InRelease  
> Hit:4 [Index of /debian](http://debian-mirror.sakura.ne.jp/debian) stretch-updates InRelease  
> Hit:5 [Index of /debian](http://debian-mirror.sakura.ne.jp/debian) stretch Release  
> Reading package lists… Done  
> Building dependency tree  
> Reading state information… Done  
> 109 packages can be upgraded. Run ‘apt list --upgradable’ to see them.  
> Reading package lists… Done  
> Building dependency tree  
> Reading state information… Done  
> default-jdk is already the newest version (2:1.8-58).  
> 0 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.  
> cpi@clockworkpi:~$ javac -version  
> javac 1.8.0\_181  
> cpi@clockworkpi:~$ java -version  
> java version “1.8.0\_181”  
> Java™ SE Runtime Environment (build 1.8.0\_181-b13)  
> Java HotSpot™ Client VM (build 25.181-b13, mixed mode)  
> cpi@clockworkpi:~$ cpi@clockworkpi:~$ javac -version  
> cpi@clockworkpi:~$ java -version  
> java version “1.8.0\_181”  
> Java™ SE Runtime Environment (build 1.8.0\_181-b13)  
> Java HotSpot™ Client VM (build 25.181-b13, mixed mode)

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)

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 25, 2018, 5:12pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/10 "2018-08-25T17:12:40Z")

</div>

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:

```auto
sudo apt remove default-jdk

```

---

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 26, 2018, 4:58pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/12 "2018-08-26T16:58:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 26, 2018, 9:38pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/13 "2018-08-26T21:38:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 26, 2018, 11:43pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/14 "2018-08-26T23:43:27Z")

</div>

That worked. Thank you.

---

<div class="post-metadata">

**Author:** ![TechniMyoko](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/technimyoko/32/2883_2.png) [@TechniMyoko](https://forum.clockworkpi.com/u/TechniMyoko)\
**Post date:** [August 26, 2018, 11:45pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/15 "2018-08-26T23:45:34Z")

</div>

![IMG_20180826_194357](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/clockworkpi/original/2X/3/3adc51c28b1cb19c8e475d610eb2e8357297015a.jpeg)

---

<div class="post-metadata">

**Author:** ![chen768959](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@chen768959](https://forum.clockworkpi.com/u/chen768959)\
**Post date:** [August 24, 2019, 9:15am UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/16 "2019-08-24T09:15:45Z")

</div>

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

 ![jdk8](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/0/0163dfc3c8804d586f0046545de6fd7bb3e6527f.png)

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 24, 2019, 9:50pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/17 "2019-08-24T21:50:22Z")

</div>

```auto
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.)

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 24, 2019, 10:17pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/18 "2019-08-24T22:17:56Z")

</div>

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

```auto
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. 😕

---

<div class="post-metadata">

**Author:** ![chen768959](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@chen768959](https://forum.clockworkpi.com/u/chen768959)\
**Post date:** [August 25, 2019, 4:33am UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/19 "2019-08-25T04:33:09Z")

</div>

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?

 ![oracle_jdk](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/d/d01411274354c8f519b1ac757216c237b10559f6.png)

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 25, 2019, 2:26pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/20 "2019-08-25T14:26:24Z")

</div>

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:

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

```

Then you see you have the right version:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Oet](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/oet/32/5786_2.png) [@Oet](https://forum.clockworkpi.com/u/Oet)\
**Post date:** [August 25, 2019, 2:32pm UTC](https://forum.clockworkpi.com/t/how-would-you-install-java-8u40/1465/21 "2019-08-25T14:32:37Z")

</div>

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`
