Is it possible to compile java source code into native exe like C++? Like C++ all headers files are included during compilation, all java library files that are required should be attached in that exe, and this exe should not be a bytecode but native exe instead and run without jvm.
So all I want to know is something like.. if I can replace all C++ syntax with Java syntax and compile to an exe file like one created by C++ compiler which run directly.
Note: I am not talking about packers that wraps java classes in exe and ultimately requires jvm.
Using GraalVM Java applications can be compiled into native standalone executables (will be demonstrated). Native executables of small Java programs startup blazingly fast, use considerably less resources compared to running on JVM and do not even require the JRE or any other kind of runtime apart from the OS.
Yes! Native Image The native image feature with the GraalVM SDK helps improve the startup time of Java applications and gives them a smaller footprint. Effectively, it's converting bytecode that runs on the JVM (on any platform) to native code for a specific OS/platform — which is where the performance comes from.
As of 2020-05 the current options include:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With