david123456
Posts: 4
Joined: Tue Sep 20, 2022 2:08 pm

running java on Pi Zero W Rev 1.1

Wed Sep 21, 2022 11:13 am

Hello,
I have a working java app that running on my PI4
I have try to run the same app on my PI-zero
Model : Raspberry Pi Zero W Rev 1.1
but I get this error :

Code: Select all

Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP
I read somewhere I need to install openjdk-7-jdk
when I try to download it I get :

Code: Select all

Package openjdk-7-jdk 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 'openjdk-7-jdk' has no installation candidate
what can I do ?
is there another solution ?


***

I have try to do as it say here
viewtopic.php?t=269072
and downloaded
sudo apt-get install openjdk-8-jdk

but I get the same error message


Thanks ,

david123456
Posts: 4
Joined: Tue Sep 20, 2022 2:08 pm

Re: running java on Pi Zero W Rev 1.1

Wed Sep 21, 2022 1:11 pm

I have found this and it's working now:

https://mstevetodd.com/raspberrypi-zero-w

maybe someone else will need this

knute
Posts: 821
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas

Re: running java on Pi Zero W Rev 1.1

Thu Sep 22, 2022 9:16 pm

Just install the Java17 from the repository. It is now compiled for the v6 chips and runs fine on the early Pis. The Pi below is a Pi B Rev 2.

Code: Select all

pi@projectroompi:~ $ sudo apt install openjdk-17-jdk
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openjdk-17-jdk is already the newest version (17.0.4+8-1~deb11u1+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

pi@projectroompi:~ $ dpkg -l | grep jdk
ii  openjdk-17-jdk:armhf                 17.0.4+8-1~deb11u1+rpt1          armhf        OpenJDK Development Kit (JDK)
ii  openjdk-17-jdk-headless:armhf        17.0.4+8-1~deb11u1+rpt1          armhf        OpenJDK Development Kit (JDK) (headless)
ii  openjdk-17-jre:armhf                 17.0.4+8-1~deb11u1+rpt1          armhf        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-17-jre-headless:armhf        17.0.4+8-1~deb11u1+rpt1          armhf        OpenJDK Java runtime, using Hotspot JIT (headless)

pi@projectroompi:~ $ java -version
openjdk version "17.0.4" 2022-07-19
OpenJDK Runtime Environment (build 17.0.4+8-Raspbian-1deb11u1rpt1)
OpenJDK Client VM (build 17.0.4+8-Raspbian-1deb11u1rpt1, mixed mode, emulated-client)

pidd
Posts: 3945
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: running java on Pi Zero W Rev 1.1

Thu Sep 22, 2022 10:43 pm

The following might be useful in the future

Code: Select all

sudo apt search openjdk

Return to “Java”