Converting .jar -> .exe, is the JVM no longer used?
Started by DrMadolite, Apr 18 2012 05:31 AM
7 replies to this topic
#1 Members - Reputation: 206
Posted 18 April 2012 - 05:31 AM
Just a newbie Java question I have, because I read something about .exe files that I'm not sure what to think of. So let me ask:
When you convert a .jar file to .exe, will it stop using the virtual machine and require the OS instead? And what is the logic behind the answer?
When you convert a .jar file to .exe, will it stop using the virtual machine and require the OS instead? And what is the logic behind the answer?
boolean thisIsNotMySignature = false;
Ad:
#3 Members - Reputation: 206
Posted 18 April 2012 - 07:17 AM
There is no proper answer without more information. There exist several tools to wrap a Java .jar file into an executable, what exactly is done depends on the tool used.
Oh ok. Well, I guess I was asking if making something into an .exe had anything to do with it being compiled all the way down to the machine language. But I take it your answer is "no, not necessaily" then?
What I've specifically done, is to use Eclipse for the coding, then use cmd to compile it to .jar (because I've been too lazy to figure out if Eclipse can do it LOL). Then, from .jar to .exe I also used the cmd. I'm completely new to the details of how file conversions affect files, so that's why I'm asking.
boolean thisIsNotMySignature = false;
#4 Senior Moderators - Reputation: 4722
Posted 18 April 2012 - 07:29 AM
There are ways to do so, for example, the GCJ compiler can compile (most) Java down to native machine code.
However, while it does allow your program to execute without the JVM being installed, it comes with certain disadvantages. For one, you need to also compile all 3rd party libraries to native code (which generally requires source-code access). And the originally intended benefit (increased performance) has been largely made irrelevant by improvements to JIT performance in the JVM.
However, while it does allow your program to execute without the JVM being installed, it comes with certain disadvantages. For one, you need to also compile all 3rd party libraries to native code (which generally requires source-code access). And the originally intended benefit (increased performance) has been largely made irrelevant by improvements to JIT performance in the JVM.
Tristam MacDonald - SDE @ Amazon - swiftcoding [Need to sync your files via the cloud? | Need affordable web hosting?]






