How do I install Java JDK? ("Exec format error") #483

Open
opened 2025-12-29 01:19:41 +01:00 by adam · 1 comment
Owner

Originally created by @Wisser on GitHub (Mar 14, 2023).

Hello,

I am trying to use the Java JDK in a "Docker-OSX" based image.
I have unpacked and started the OpenJDK, but I get:

sh-5.1$ ./jdk-19.0.2.jdk/Contents/Home/bin/java
sh: ./jdk-19.0.2.jdk/Contents/Home/bin/java: cannot execute binary file: Exec format error

(I also tried the Oracle JDK, with the same result).

I am using Windows 10 on an Intel 64 bit environment with WSL2.

# OS related issued, please help us identify the issue by posting the output of this
uname -a \
; echo "${DISPLAY}" \
; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs \
; grep NAME /etc/os-release \
; df -h . \
; qemu-system-x86_64 --version \
; libvirtd --version \
; free -mh \
; nproc \
; egrep -c '(svm|vmx)' /proc/cpuinfo \
; ls -lha /dev/kvm \
; ls -lha /tmp/.X11-unix/ \
; ps aux | grep dockerd \
; docker ps | grep osx \
; grep "docker\|kvm\|virt" /etc/group
Linux a699e107d64f 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 GNU/Linux
:0.0
tee: /sys/module/kvm/parameters/ignore_msrs: Read-only file system
1
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
Filesystem      Size  Used Avail Use% Mounted on
overlay         251G   13G  226G   6% /
QEMU emulator version 7.2.0
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
libvirtd (libvirt) 9.0.0
               total        used        free      shared  buff/cache   available
Mem:            12Gi       911Mi       3.8Gi       1.0Mi       7.6Gi        11Gi
Swap:          4.0Gi        11Mi       4.0Gi
16
egrep: warning: egrep is obsolescent; using grep -E
0
ls: cannot access '/dev/kvm': No such file or directory
total 8.0K
drwxr-xr-x 2 root root 4.0K Mar 14 12:52 .
drwxrwxrwt 1 root root 4.0K Mar 14 12:52 ..
arch        33  0.0  0.0   3976  2336 pts/1    S+   13:09   0:00 grep dockerd
sh: docker: command not found
kvm:x:992:libvirt-qemu,qemu
libvirt:x:973:
libvirt-qemu:x:970:
libvirtdbus:x:969:
Originally created by @Wisser on GitHub (Mar 14, 2023). Hello, I am trying to use the Java JDK in a "Docker-OSX" based image. I have unpacked and started the OpenJDK, but I get: ``` sh-5.1$ ./jdk-19.0.2.jdk/Contents/Home/bin/java sh: ./jdk-19.0.2.jdk/Contents/Home/bin/java: cannot execute binary file: Exec format error ``` (I also tried the Oracle JDK, with the same result). I am using Windows 10 on an Intel 64 bit environment with WSL2. ``` # OS related issued, please help us identify the issue by posting the output of this uname -a \ ; echo "${DISPLAY}" \ ; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs \ ; grep NAME /etc/os-release \ ; df -h . \ ; qemu-system-x86_64 --version \ ; libvirtd --version \ ; free -mh \ ; nproc \ ; egrep -c '(svm|vmx)' /proc/cpuinfo \ ; ls -lha /dev/kvm \ ; ls -lha /tmp/.X11-unix/ \ ; ps aux | grep dockerd \ ; docker ps | grep osx \ ; grep "docker\|kvm\|virt" /etc/group ``` ``` Linux a699e107d64f 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 GNU/Linux :0.0 tee: /sys/module/kvm/parameters/ignore_msrs: Read-only file system 1 NAME="Arch Linux" PRETTY_NAME="Arch Linux" Filesystem Size Used Avail Use% Mounted on overlay 251G 13G 226G 6% / QEMU emulator version 7.2.0 Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 9.0.0 total used free shared buff/cache available Mem: 12Gi 911Mi 3.8Gi 1.0Mi 7.6Gi 11Gi Swap: 4.0Gi 11Mi 4.0Gi 16 egrep: warning: egrep is obsolescent; using grep -E 0 ls: cannot access '/dev/kvm': No such file or directory total 8.0K drwxr-xr-x 2 root root 4.0K Mar 14 12:52 . drwxrwxrwt 1 root root 4.0K Mar 14 12:52 .. arch 33 0.0 0.0 3976 2336 pts/1 S+ 13:09 0:00 grep dockerd sh: docker: command not found kvm:x:992:libvirt-qemu,qemu libvirt:x:973: libvirt-qemu:x:970: libvirtdbus:x:969: ```
Author
Owner

@sickcodes commented on GitHub (May 7, 2023):

Did you download the macOS version? You could try download it from homebrew.

@sickcodes commented on GitHub (May 7, 2023): Did you download the macOS version? You could try download it from homebrew.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#483