Jump to content
  • Advertisement
Sign in to follow this  
Ronnie Mado Solbakken

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

This topic is 2281 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Out of curiousity: how did you do that?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!