Eventually openJDK (JRE) couldn't work.
↓ What I was trying to write below
I had a binary that only works on an ARM CPU, and I wanted to run it on a mac. Well, mac is Intel, so of course it is impossible as it is.
So, I considered a PC with ARM, but it's a little annoying to make a new instrument, so when I look for an emulation There was something called QEMU. (By the way, I also have a Raspberry Pi, but I'm sorry (
qemu arm [raspbian] So built. At first, I tried to download the kernel and start it, but it was very difficult and failed, so I omitted it.
So I used this one. https://github.com/karaage0703/raspbian_on_qemu https://qiita.com/karaage0703/items/366eb17906a3341f1999 I also referred to this. Thank you very much.
I also wanted to use ssh, so
Enable ssh with sudo raspi-config
.
Added port forwarding to qemu command
$ qemu-system-arm -kernel kernel-qemu-4.19.50-buster -dtb versatile-pb.dtb -m 256 -M versatilepb -cpu arm1176 -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -drive file=2019-09-26-raspbian-buster.img,format=raw -no-reboot -net nic -net user,hostfwd=tcp::10022-:22
(By the way, I wanted to increase the memory from 256, but it seems that this is the upper limit because it is the limit of qemu)
-net nic -net user,hostfwd=tcp::10022-:22
Was added.
Now ssh is connected with localhost -p 10022
.
By default, the disk size is small, so ʻapthas no size, so it stops. So extend img
qemu-img resize 2019-09-26-raspbian-buster.img +4G Start with
fdiskand
sudo resize2fs /dev/sda2`
So the original requirement was to run java, but it will be difficult from now on.
java
If it is left as it is, java will throw an error and will not work.
Server VM is only supported on ARMv7+ VFP
↑ Such an error
So I will build it while referring to various articles. First, delete the current java. (Apt remove, etc.)
Still something remained, so
which /usr/bin/java
ls -la /usr/bin/java
Look for the substance of java.
/usr/lib/jvm/java-9-openjdk-armhf/bin/java
It should be around here.
dpkg -S /usr/lib/jvm/java-9-openjdk-armhf/bin/java
Details in
openjdk-9-jre-headless:armhf: /usr/lib/jvm/java-9-openjdk-armhf/bin/java
Because there was, ʻapt remove open jdk-9-jre-headless`
Erase with.
Then I reinstalled it, but in the end I just got the above error message and couldn't run Java. I decided to give up and look for another method.
Recommended Posts