Compiling java to .exe's

The subject says it all. Is there any way to do this? It would just make (my) Java games accesible to a much wider audience.

The program you want is Excelsior’s JET.

However, it is quite possible you don’t actually want it.

Most desktop PC’s now have the latest version of java installed (as far as we can guessimate from Sun’s figures - I’ve asked for more exact numbers but no-one knows any) so “reaching more people” isn’t necessarily worth compiling to native code (although there are other reasons you might want to do this, and you will still increase your market by doing this too - but be sure to get a good idea of by how much before you spend too much time doing it)

Im suprised Blah didnt say this lol but, using webstart instead of an exe would make it more accessible to a larger audience than using an exe, just get a webpage and direct everyone to it with a link that links to the JNLP file and your off. Im not really sure how well the exe compiler things work though.

Actually Webstart would probably be on a par with a .exe, and then only if it worked properly on a crap old Mac.

With a .exe you can expect approximately 4x as many downloads compared to a jnlp launch.

This is the reality of Java penetration.

I suggest being naughty and distributing a VM embedded in the game for Windows users without Java.

Cas :slight_smile:

how would you embed the JVM cas? ive tried before, but I didn’t know where to start, which files to copy…etc.

Any help with this is greatly appreciated.

I couldn’t possibly be seen to help in this matter in public 8)

Cas :slight_smile:

Redistribution of Java is perfectly legal, as long as you follow the rules.

If you read the license agreement, it directs you the README file located in the root directory of your JDK or JRE installation. That file contains information about redistribution. Sun defines “required” and “optional” files and lists the optional ones (all those not mentioned being required). There doesn’t seem to be any requirement about how the files are packaged for redist (i.e., in your own setup.exe without Sun’s installer).

In addition, in the JRE README, Sun even allows you to copy the server VM from the JDK and redist that with the JRE. That should please some people.

I imagine the only difficult part is actually building the installer to put all the files in the right places, but that can’t be too hard for anyone ready to build an installer.

Just to be clear, I am not a lawyer, nor am I practicing to be one. Read the docs for yourself.

-Tab

Yeah, there’s like, this bug in my installation script, and about 11mb of useless crap seems to have gotten accidentally left out of the distribution…

Cas :slight_smile:

I would rather download Excelsior Jet than trying to include the VM yourself. I downloaded the trail version, it seems to do its job well. I only tried to use it once so far and it generated a 20meg file for a 400kb game (though thats the installer, it includes a VM which, for me, kind of defeats the purpose of compiling to exe anyway). I haven’t got a hyperlink ready but search for it and you’d find it easily.

This may help: http://jsmooth.sourceforge.net/. It embeddes a jar file into an exe. It does not bundle the java runtime as well, though.

[quote]This may help: http://jsmooth.sourceforge.net/. It embeddes a jar file into an exe. It does not bundle the java runtime as well, though.
[/quote]
Hey thanks for that. That looks like a really great option for some of the things that I wanted to do. Great find.

Even though it’s licensed under GPL they give the exception that .exes generated don’t need to follow the license, just the software itself. Excellent.