I'd rephrase your question: "If I compile my java program to machine
code, do I still need a Sun's JRE installed on end-user machines?".
The answer depends on what product you are going to use, and what APIs
your Java application uses.
1. You can use GCJ (
http://gcc.gnu.org/java/). This is free product.
Using GCJ, you do NOT have to have JRE installed, all necessary APIs
are linked into your program (GCJ guys, correct me if I'm wrong).
So far, you can use GCJ for a limited class of applications (no Swing,
no Java 1.5 features).
2. You can use Excelsior JET 3.7
(
http://www.excelsior-usa.com/jet.html). This is commercial product. It
supports all Java APIs and all Java versions.
Using JET 3.7, in most cases, you DO HAVE to have JRE installed (JET
can bundle JRE to your application and install automatically, but the
application package size increases).
3. You can wait few weeks and then use JET4.0, which will be released
by the end of September.
Using JET4.0, you do NOT have to have Sun's JRE installed or bundled.
I am not avare of any other tools that can compile your java applicaton
to native .exe for Windows or Linux.
Besides that, there are plenty of "java to exe wrappers" - these are
programs that do not compile your code, but just bundle JARs and JRE
into one big executable. This way, you do not have to have JRE
installed, but the size of your executable = size of your program +
size of JRE.
You can read this article for more details:
http://www.excelsior-usa.com/articles/java-to-exe.html
Your questions are welcome.
Denis,
Excelsior LLC