[java] .Java Files As An .EXE

Started by
14 comments, last by swiftcoder 18 years, 2 months ago
Does anyone have a way to turn my .java files into a stane-alone executable file?
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.
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.
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.
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.
The JSmooth tools may be helpful.
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.
To win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.
The cheapass version of JET costs very little.

Cas :)
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.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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
a.k.a javabeats at yahoo.ca

This topic is closed to new replies.

Advertisement