I want to create a Java program.
The program is converted into bytecode and then depeding on the machine, it is run by JIT.
But still *.exe is not created.
So even after deploying a java program, do I need JVM to run it.
Can't I generate its *exe based on the machine architecture?
Is JVM needed to run every java program
Generally, you need a JRE. A common option is to include a JRE in your installation. Another option might be to use a compiler like GCJ.
Sure there are some experimental compilers that let u compile java directly to machiencode, but why would you?
First of all they are experimental and u will have a lot of problems using them,
sencondly the JVM is such hightech machiene that you probably will get way worse performance.
First of all they are experimental and u will have a lot of problems using them,
sencondly the JVM is such hightech machiene that you probably will get way worse performance.
Generally, you need a JRE. A common option is to include a JRE in your installation. Another option might be to use a compiler like GCJ.
Ok I will include that; but will it create *.exe file after installation?
How the application will run?
Do I have to use 'java sample.class' to run the program?
What if I want to avoid this and deploy the program to a non-technical person?
He should be able to run (not install) the java program without JRE, by just double clicking the *exe. Is it possible.
How to do that?
I want to create a Java program.
The program is converted into bytecode and then depeding on the machine, it is run by JIT.
But still *.exe is not created.
So even after deploying a java program, do I need JVM to run it.
Can't I generate its *exe based on the machine architecture?
The short answer is, yes, in general, you need a JVM to run a program written in Java.
But the bigger question is, if you are trying to generate an *.exe, why are you using Java?
The main reason no such tools exist and why it's effectively no possible is legal.
Java is complex ecosystem, but some crucial parts are essentially proprietary to what is now Oracle. So even if you manage to overcome all the technical hurdles (which means your executable must contain JVM), you cannot do without the JDK or SDK packaged classes, since those aren't redistributable or may not be modified. The open source versions and alternate implementations however are not complete, again due to licensing issues. Also see the recent Google/Oracle legal fight over Java.
Java is complex ecosystem, but some crucial parts are essentially proprietary to what is now Oracle. So even if you manage to overcome all the technical hurdles (which means your executable must contain JVM), you cannot do without the JDK or SDK packaged classes, since those aren't redistributable or may not be modified. The open source versions and alternate implementations however are not complete, again due to licensing issues. Also see the recent Google/Oracle legal fight over Java.
Can't I generate its *exe based on the machine architecture?[/quote]
Yes, that is possible (see Eclipse).
But it still requires JVM for reasons mentioned above.
...they are experimental and u will have a lot of problems using them...
Excelsior JET (which SiCrane mentioned) is far from experimental and supposedly generates very well performing native code executables.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement