Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling java into native code? [duplicate]

I'm trying to find a java compiler that I can use to compile my java code into native binaries on different operating systems. I have heard of the GNU Compiler for Java but I can't seem to find a download for that and I think it's dead anyway. Are there any good up-to-date compilers out there that I can use to compile java code into a .exe and a .app or anything or can you tell me how to get the GNU Compiler for Java.

like image 778
kzolp67 Avatar asked May 03 '13 13:05

kzolp67


People also ask

Can Java be compiled to native code?

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.

Can Java be compiled to EXE?

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.

Can you compile Java to binary?

Native Image is a technology to compile Java code ahead-of-time to a binary – a native executable. A native executable includes only the code required at run time, that is the application classes, standard-library classes, the language runtime, and statically-linked native code from the JDK.

What is Java native compilation?

Native code compiler for Java translates the Java code into a binary representation that can be linked to precompiled library files and resources to create an executable program. Native code compilers eliminate the need for JVM and interpreters to convert the Java byte code, which is a portable intermediate code.


1 Answers

GNU Compiler for the Java can be found at http://gcc.gnu.org/install/binaries.html

And you may try the following tools:

  • JET: http://www.excelsior-usa.com/jet.html
  • Exe4j: http://www.ej-technologies.com/products/exe4j/overview.html
like image 83
zhuwenger Avatar answered Sep 30 '22 06:09

zhuwenger