You can use GraalVM to compile Java apps to native platform executables.
First install GraalVM following steps here: https://www.graalvm.org/docs/getting-started/#install-graalvm
Install the native-image plugin:
gu install native-image
Compile your Java app with javac as normal:
javac YourApp.java
Compile to a native executable:
native-image YourApp
Execute your native executable:
./YourApp
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…