Jump to content

  • Log In with Google      Sign In   
  • Create Account


Converting .jar -> .exe, is the JVM no longer used?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Malabyte   Members   -  Reputation: 588

Like
0Likes
Like

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?

- Awl you're base are belong me! -

- I don't know, I'm just a noob -


Sponsor:

#2 BitMaster   Crossbones+   -  Reputation: 3918

Like
0Likes
Like

Posted 18 April 2012 - 06:22 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.

#3 Malabyte   Members   -  Reputation: 588

Like
0Likes
Like

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.

- Awl you're base are belong me! -

- I don't know, I'm just a noob -


#4 swiftcoder   Senior Moderators   -  Reputation: 9882

Like
0Likes
Like

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.

Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#5 cmasupra   Members   -  Reputation: 145

Like
0Likes
Like

Posted 18 April 2012 - 08:24 AM

If you're looking to make your game able to run on Windows without the JRE being installed, you can also use Launch4j. It allows you to bundle the JRE of your choosing into the .exe file or the equivalent of a .exe on each platform.

#6 Malabyte   Members   -  Reputation: 588

Like
0Likes
Like

Posted 18 April 2012 - 08:50 AM

Ok thanks guys. I wasn't actually trying to make it not require JVM, I just wanted to know how things are. Cheers. Posted Image

- Awl you're base are belong me! -

- I don't know, I'm just a noob -


#7 brx   Members   -  Reputation: 713

Like
0Likes
Like

Posted 18 April 2012 - 09:28 AM

Then, from .jar to .exe I also used the cmd.

Out of curiousity: how did you do that?

#8 Malabyte   Members   -  Reputation: 588

Like
0Likes
Like

Posted 18 April 2012 - 09:52 AM

Out of curiousity: how did you do that?


Oh man, I completely forgot by now, and I can't seem to find the video that showed how LOL. String epicFail = true();

- Awl you're base are belong me! -

- I don't know, I'm just a noob -





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS