tags:

views:

387

answers:

7

Hi

I want to run a java program as an exe in windows the windows box doesnt install java at all...

So, is there any other way in which the java program can be converted to exe which takes of this JRE dependencies etc???

Thanks Shiv

A: 

For the application to run you will need the runtime. In fact the very first thing that happens when you start the app is a call is a made to OS to start JRE. You cannot do without JRE.

[You can of course embded JRE into your app itself if you want].

Sesh
As far as I know, you're not wrong, but I'm curious; why is this the case? There are a few different utilities (py2exe is one) which package the Python interpreter with an installer.
Imagist
The whole point of virtual machines is that you want to abstract the application from the underlying OS. Another example is garbage collection. There is no way garbage collection is going to work without someone overlooking the application and taking care of releasing memory when the object goes out of scope. This is done by the JRE.
Sesh
+3  A: 

You can use Excelsior JET compiler for that purpose.

See http://www.excelsior-usa.com/ for more information on this.

Vanya
A: 

GCJ can create native code from Java source files. Here's a tutorial on how to build it in Windows.

Cinder6
can you tell, how good does GCJ deal with Java 1.5 and 1.6 features?
Vanya
Last I knew, it's only working with JDK 1.4, which is too bad.
Cinder6
+1  A: 

You can ship the JRE with your application and use that JRE for your application. The effect is the same: The application will be started through an executable (wrapper needed) or script (batch) file and the target machine does not need to have a java runtime installed.

Java doesn't have to be 'installed', it just has to be 'present'.

Andreas_D
A: 

I have used JSmooth to exify my application. It also allows for embedding a JRE inside. I just used the "ensure that at least Java X is available".

GPL, can be run as an ant task.

Thorbjørn Ravn Andersen
A: 

Have you tried install4j? There are various versions, some free, of this concept. Basically, this application compiles your application into an executable installer, specific to the OS of your choice.

Yuval
+1  A: 

Jexepack