Sign in to follow this  

[java] .Java Files As An .EXE

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

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
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
Hi!
Try either the open-source JSmooth (http://jsmooth.sourceforge.net/) or the exe4j program which is a shareware and cost some money. I've tried both of them, worked great. I prefer JSmooth more.
Hope this helps!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by swiftcoder
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.


Wings3d is written in Erlang though, not Java. Your exe loader is probably just a bash script that calls the Erlang interpreter ("erl") on the source file or on "byte code".

As for turning a Java application into an "exe", there is GCJ. I don't know if it is available on Windows, and I don't know how complete/compatible/etc it is.


Hope this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
Original post by swiftcoder
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.


Wings3d is written in Erlang though, not Java. Your exe loader is probably just a bash script that calls the Erlang interpreter ("erl") on the source file or on "byte code".


No, it is actually an executable, not a bash script (it has its own icon, system menus etc. and the filesystem identifies it as an 'Application' not a 'Unix executable'). But it is actually just a loader, as you suggested, not a packaged interpreter (it loads a seperate 'wings' proccess).
I hadn't realized Wings3d was in Erlang though, thanks for the info.

Share this post


Link to post
Share on other sites

This topic is 4345 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this