Jump to content
  • Advertisement
Sign in to follow this  
ace84_84

[java] .Java Files As An .EXE

This topic is 4538 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

Advertisement
compile your code into a .jar file.
jar files are like zip files(they can contain alot of files) and they can be executable if if they are made correctly, there's a file named "manifest", I think, and it can configure your jar file to make it executable.

If you use an IDE, it's easy to make an executable jar file for your app.
If you're a command-line kind of guy, you're on your own!!! lol google it or wait for someone more intelligent than me.

To execute your java code with a .exe??? I dont know how, but I've read it's possible

watch out, winrar and some other programs might try to open jar files so you'll have to configure those apps to remove the jar file type from they're known file type.

Share this post


Link to post
Share on other sites
I would say you should just go with the .jar file. It is just like an .exe(opens with double click) You can easily make them with a java IDE called BlueJ. The other way is on the command line which I haven't used that much.

Share this post


Link to post
Share on other sites
There's two catches: if the JRE isn't installed, the program won't execute (obviously).

Second, there's no guarantee that the .jar file extension is associated with the JRE in any way on a random system.

Share this post


Link to post
Share on other sites
Yes it can happen. There's this one Java 3d Blender-ish, 3DSMax-ish program. There's a separate .exe file that opens the jar file. Hehe.. I don't remember what the name of the program was.

Share this post


Link to post
Share on other sites
If you have a bit of money, you might try the JET compiler. It's reasonably good, though unfortunately out of my price range for now. It does tend to make rather large exes, though, so for tiny snippets you are probably better off with the JSmooth tools.

Share this post


Link to post
Share on other sites
Quote:
Original post by romainechester
Yes it can happen. There's this one Java 3d Blender-ish, 3DSMax-ish program. There's a separate .exe file that opens the jar file. Hehe.. I don't remember what the name of the program was.


Perhaps Wings3d? It uses an exe loader on Mac OS X at anyrate. It is open source, so you could look and see how they do it.

Share this post


Link to post
Share on other sites
And there are those who bundle the entire JVM with their programs. You can write a small C/C++ program (.exe) that loads your own program, using it's own JVM or whatever JVM you have already installed on your system. It might give you some trouble at first to use the SO's APIs, but it might prove worth the effort on a big project.

Son Of Cain

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!