say, convert to a windows exe.
seems interesting but i’m doubting that there would be a memory leak issue unless it’s smart enough to free unreferenced objects as we manually do with C++.
Fortunately, it is that smart
Do you really want native code, or just an exe launcher?
You can get the latter from any installer generator as well as some other free launcher projects.
Precompiling will bloat your code on the desktop and prevent it from being used on other platforms, and I can’t see any advantage beyond improved startup time.
That is true. But, sometimes, someone wants to see your project and he want it to be “for Win platform”. He just wants to double click on shortcut and that will start the game/program. Inthat cases, it is good to have launch4j or similar exe maker.
the main advantage is that your average target doesn’t have to download and install a 15M jre to see your 2k “hello wordl” aplication
right, which is why I mentioned them and the installer generators which will all make the same kind of launcher for you.
But none of these “convert Java to exe”, they mearly provide an exe front end for launching the VM and Java app, which is why I asked what he really wanted and why.
the main advantage is that your average target doesn’t have to download and install a 15M jre to see your 2k “hello wordl” aplication
Yup. If thats all your writing-- hello world.
For an app of any significant size though code bloat will quickly run your size way up, and then you need to dl all that bloat every time instead of dling a VM once.
you could also have a look at gcc 4.0 (gcj) which compiles to native code, i’ve heard that with the latest versions theres a pretty good chance that you app will be supported.
have a look at http://www.java-gaming.org/forums/index.php?topic=12400.0
Jet is extremely good though But Hello World will still weigh in at many megabytes unless you are familiar with all sorts of tricks. The smallest I got it was half a meg. Of course the example is completely irrelevant in the real world.
“Beyond startup time” – well, startup time is still significant in JRE deployed applications, and Jet starts in the blink of an eye, and then runs at full pelt thereafter. To get the same performance out of current Sun VMs means waiting a minute or so while it boots and warms up, and using the server VM. So there is a concrete advantage to Jet, especially if first impressions count.
Cas
“Beyond startup time” – well, startup time is still significant in JRE deployed applications, and Jet starts in the blink of an eye, and then runs at full pelt thereafter. To get the same performance out of current Sun VMs means waiting a minute or so while it boots and warms up, and using the server VM. So there is a concrete advantage to Jet, especially if first impressions count.
Well you can force Hotspot to compile up front, or run a warmup loop, so I dont buy that first impressions of execution speed have to be any different.
Maybe I stated the other badly. Let me try again. IF you need something that will start up almost immediately, then yes pre-compiling is your only option. The price you pay for that is either slower actual execution or bloat.
In some apps this tradeoff is absolutely worth it. You wouldnt want to write many of the little command line Unix utilities in Java without compiling them. Waiting for Java class load time to do an “ls” as an example would be silly.
Mostly it comes down to what % of your run time that startup will be. if its significant then yes you might want to do something about it like pre-compiling.
In some apps this tradeoff is absolutely worth it. You wouldnt want to write many of the little command line Unix utilities in Java without compiling them. Waiting for Java class load time to do an “ls” as an example would be silly.
Err… like
javac
jar
javah
javap
keytool
pack200
(I believe all of which are written in Java :))
Actually if you don’t pull in Swing or other big frameworks, small java tools don’t take too long to launch.
Just as an experiment I coded up a quick ‘ls’… you can tell there is a slight hesitation before it starts, but it isn’t really irritating, it’s under half a second for sure. (Using Mustang b71)
yes there is: www.excelsior-usa.com/jet.html commercial but powerful
Bruno
Can Exelsior also compile swt/jface in combination with jogl?
Wow, I’m surprised no-one mentioned GCJ - the GNU Java Compiler yet. The latest version is allowing me to compile my full game to natives for windows and linux.
Kev
Probably because you’re some sort of pioneer in this field, Kev!
Cas
Meh! Pinoneer, Sminoeer - it works and it works now!
Kev