7

I am using Raspberry PI Zero W. I installed java 1.8 and 1.9 jdk's. Installation is successfully done. When i run the JAVA command on the RPi. Its shows error like: "Error occurred during initialization of VM Server VM is only supported on ARMv7+ VFP"

Please give me solution on the error?

Fred
  • 4,552
  • 18
  • 29
Nagaraj
  • 119
  • 1
  • 1
  • 5

4 Answers4

4

If you have installed java 8 and still can't seem to get the VM to run then try:

sudo update-alternatives --config java

<blockquote>
  <blockquote>
    <blockquote>
      <p>Select java 8's menu number</p>
    </blockquote>
  </blockquote>
</blockquote>

Java 8 should work just fine thereafter

3

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.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
Fred
  • 4,552
  • 18
  • 29
  • Oracle actually did have a release for ARMv6 that ran on the model 1 Pis (which have the exact same CPU as the Zero), for java 7 and then 8. There are references here about those going back to 2013. I don't know how long the kept it up beyond that, but last I checked it was gone (and since ARMv6 is not widely used, it is very unlikely to be coming back). – goldilocks Oct 03 '19 at 13:31
  • Searching for 'jdk' does turn out some relevant results: https://raspberrypi.stackexchange.com/questions/91/is-there-a-jdk-with-a-jit-compiler-available and https://raspberrypi.stackexchange.com/questions/4683/how-to-install-the-java-jdk-on-raspberry-pi/ but they are a bit dated, the 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
  • Now, its working fine, i degraded java version. – Nagaraj Oct 04 '19 at 05:25
  • @Nagaraj Please accept the answer with a tick on the tick on the left side on it. This finished your question and show me and others that I don't have to look for a help to you anymore. – Ingo Oct 16 '19 at 09:20
3

I just installed Buster on my old Pi1 B+ and ran into the same problem.

after

sudo apt-get install default-jdk

the JavaVM didn't run.

I removed it and installed

sudo apt-get install java-8-jdk

now it starts.

1

I ran into the same issue, see Java 11 not working

There doesn't seem to be a Java version for older Pi's and the zero as they use an ARM6 processor, while the newer boards have a 7 or 8 and those are completly different processors.

Frank
  • 318
  • 1
  • 8