Create an ARM-cpu environment with qemu on mac and run java [Result → Failure]

As a result, this content is a construction failure. I will leave it as a memorandum.

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.

Disk expansion

By default, the disk size is small, so ʻapthas no size, so it stops. So extend imgqemu-img resize 2019-09-26-raspbian-buster.img +4G Start withfdiskandsudo 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

Create an ARM-cpu environment with qemu on mac and run java [Result → Failure]
Create a Java development environment using jenv on Mac
Build Java development environment with VS Code on Mac
Create an immutable class with JAVA
Run an application made with Java8 with Java6
Install Java development environment on Mac
[Java] Create an executable module with Gradle
What is Java and Development Environment (MAC)
Build an environment with Docker on AWS
Create a java web application development environment with docker for mac part2
Run Ubuntu + ROS with Docker on Mac
Install Docker and create Java runtime environment
Building an environment for WordPress, MySQL and phpMyAdmin with Docker Compose on EC2
Install java and android-sdk on Mac using homebrew
Put Java 11 and spring tool suite on mac
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Run Edge (Chromium version) on Mac with Selenium
Build an E2E test environment with Selenium (Java)
Create jupyter notebook with Docker and run ruby
Run an application made with Go on Heroku
[Ruby on Rails] Let's build an environment on mac
Compile and run Java on the command line
Prepare a scraping environment with Docker and Java
Create a Java (Gradle) project with VS Code and develop it on a Docker container
Create an environment for Tomcat and Postgres on a Chromebook without using developer mode
Compiled kotlin with cli with docker and created an environment that can be executed with java
Create a Java (Maven) project with VS Code and develop it on a Docker container
Compile with Java 6 and test with Java 11 while running Maven on Java 8
Create an EC site with Rails5 ④ ~ Header and footer ~
Create an E2E test environment with Docker x Cypress
Create a user with an empty password on CentOS7
[Note] Create a java environment from scratch with docker
I struggled with pip install on an M1 Mac
Prepare the environment for java11 and javaFx with Ubuntu 18.4
Run kuromoji on Win10 + Eclipse + Java environment (January 2020 version)
Serverless Java EE starting with Quarkus and Cloud Run
How to create an environment that uses Docker (WSL2) and Vagrant (VirtualBox) together on Windows
Run STS4 on Mac
Maybe it works! Create an image with Docker and share it!
I tried to create a java8 development environment with Chocolatey
Create an AWS IoT EduKit development environment with Ubuntu 20.04 + VirtualBox 6.1
Getting started with Java and creating an AsciiDoc editor with JavaFX
Using multiple versions of Java with Brew on Mac + jEnv
What happened in "Java 8 to Java 11" and how to build an environment
Build a CentOS 8 virtual environment on your Mac with VirtualBox
Create Rails5 and postgresql environment with Docker and make pgadmin available
Create a Java and JavaScript team development environment (gradle environment construction)
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
Building an environment for creating apps with Rails and Vue