by Tony Sintes

Native compilation with Java

news
Jun 15, 20011 min

Can you compile Java code into a native executable?

I routinely receive two questions:

  1. “How can I compile my Java code into a native executable?”
  2. “I know about VisualAge and TowerJ, but doesn’t the JDK ship with a native compiler?”

Answer: Native compilation is a hot issue. I routinely receive emails on the subject. In fact, two Java Q&As address this subject:

  • “Create a Native Java Executable, Revisited,” (JavaWorld, June 2000)
  • “Run the Java Program Without the JDK Runtime? Yes You Can! (JavaWorld, April 1999)

Rather than try to explain how to natively compile an application (again), I will point you to an excellent resource. Please see “Webpages Related to Compiling the Java Programming Language .” This Webpage is one of the most complete resources on natively compiling Java on the Net.

In summary, to natively compile Java code, you’ll need to download a compiler and you might need to fork over some cash.

Question 2: “I know about VisualAge and TowerJ, but doesn’t the JDK ship with a native compiler?”

Answer: No!

I think that should finally put the issue to rest.