sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
36.13k stars 1.78k forks source link

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

Open Wisser opened 1 year ago

Wisser commented 1 year ago

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:
sickcodes commented 1 year ago

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