Can I compile Java for my own code?

Is there a way to compile Java from standalone (or library) machine code without requiring a JVM?

+46
java compilation native-code
Jun 07 '10 at 17:41
source share
3 answers

Previously, the GCJ tool was used, which was part of GCC, but was removed . Now all links on the GCC website are redirected to their equivalents without GCJ.

NB: all comments refer to my original answer saying that you can compile Java to native code with GCJ.

+32
Jun 07 '10 at 17:45
source share

Excelsior JET is a commercial Java compiler with native code.

+14
Jun 07 '10 at 20:38
source share

Yes, the JIT in the JVM does just that for you.

In fact, it can generate faster code than compiling the code in advance, because it can generate code optimized for a particular platofrm based on how the code is used at runtime.

+7
Jun 07 '10 at 19:01
source share



All Articles