It looks like Oracle has not released an up-to-date Java build that supports the BCM2835 (the CPU in the Pi Zero W). (See Cannot execute or open .jar files, Raspberry Pi 0 W and armv6.)
It looks like there are three options in this instance. 1) Switch to a Raspberry Pi 2 or newer, which have an ARMv7 or better, and support the official JDK. 2) Switch to OpenJDK, an alternative to Oracle's JDK. 3) Try the old Java SE Embedded.
To use OpenJDK:
sudo apt-get update
sudo apt-get install openjdk-7-jdk
To use Java SE Embedded:
Download the latest release from Oracle's website, which at the time of writing this is ejdk-8u211-linux-arm-sflt.tar.gz. Unfortunately you'll need to register to do this. Extract it using tar zxvf ejdk-8u211-linux-arm-sflt.tar.gz
. To run java then cd jdk*/bin
and then java -version
to get started.
oracle-java7-jdk
package is no longer in repositories. I think you could manually install it following the same direcitions from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html though. – Fred Oct 03 '19 at 14:35