after building the static libs, I want to build the launchers (e.g. java) This does not mean we are going to use these launchers at runtime, but it is good to have them for development/testing.

May 24
Hello, World running on linux-x86_64.

The launcher is now linked with libjvm.a, libjava.a and libnio.a. I explicitly add the symbols that are used in JNI calls (they are not directly referred to, so have to add them in the link script which is here
The launcher is here

The java.base module need to be copied into /modules and the java.security file needs to be in /conf/security

Before linking, we need to have a build of OpenJDK. My experimental work is in https://github.com/johanvos/jdk/tree/statichotspot Build it as follows:

sh configure \
--with-jvm-variants=minimal \
--with-build-jdk=/opt/jdk-23 \
--enable-static-build \
--enable-debug \
--with-native-debug-symbols=internal
Next, make the libs:
make LOG=info,cmdlines static-libs-image

May 24
I can now print a Java stacktrace:

Caused by: java.lang.NullPointerException
        at jdk.internal.util.StaticProperty.getProperty(java.base/StaticProperty.java:117)
        at jdk.internal.util.StaticProperty.(java.base/StaticProperty.java:81)
        at jdk.internal.loader.BootLoader.(java.base/BootLoader.java:62)
        at java.lang.ClassLoader.findNative(java.base/ClassLoader.java:2450)
        at java.lang.Thread.registerNatives(java.base/Native Method) 
        at java.lang.Thread.(java.base/Thread.java:223)

May 23:
Work on creating/starting the VM

May 22: all required libs are build for linux-x86_64. Now creating an own launcher and linking it with those libs.

May 21:
command: make launchers -> fails since it is trying to build a shared lib (instead of a dynamic) for x86_64 (instead of arm64) [in parallel]: one of the changes for mobile doesn't seem mobile-specific to me, see https://mail.openjdk.org/pipermail/build-dev/2024-May/045035.html