aspose file tools*
The moose likes Java in General and the fly likes Making a .exe File. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Making a .exe File." Watch "Making a .exe File." New topic
Author

Making a .exe File.

Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99
I have made a swing application and made an executable JAR file. Thats working properly.
But it works only in the machines which have JDK installed.
So i want to make an .exe file for that.
How can i make a .exe file. Does a exe file runs even JDK is not installed?
Tell me the process of making a .exe file.


SCJP 1.5
Balasubramanian Chandrasekaran
Ranch Hand

Joined: Nov 28, 2007
Posts: 215

Originally posted by Bharadwaj Adepu:
I have made a swing application and made an executable JAR file. Thats working properly.
But it works only in the machines which have JDK installed.
So i want to make an .exe file for that.
How can i make a .exe file. Does a exe file runs even JDK is not installed?
Tell me the process of making a .exe file.


First thing it is not an advanced question.

I had the same query when i first joined in this forum and i got the answer.
I don't have time to personally check that one so here i point you to that thread
[ January 24, 2008: Message edited by: Balasubramanian Chandrasekaran ]
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
It is extremely unusual to compile Java code directly to a native executable. It's right against the spirit of Java. I don't know whether the native compiler mentioned in the linked topic really allows all Java features to be used, either.

You should take your lead from Sun, the inventors of Java, who never mention the possibility of compiling to native executables.

Much more usual would be something like Java Web Start, to manage the location and/or installation of a Java Runtime Environment (JRE). Or you could use a proper installer like InstallAnywhere, which will install the JRE with your application.

Why do you think you really want an EXE native executable file?

If you really want an EXE native executable, perhaps you shouldn't be using Java at all.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Petrus Pelser
Ranch Hand

Joined: Feb 20, 2006
Posts: 132
In Java, an executable JAR file is the EXE! But you will need the JRE installed in any case.
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Originally posted by Petrus Pelser:
In Java, an executable JAR file is the EXE! But you will need the JRE installed in any case.


In the thread pointed to by previous poster, there was a link to a genuine native compiler for Java. This really does produce an EXE native executable, which does not need a JRE.

However, this is a very un-Java thing to do, and not recommended in all but the most specialised cases.
 
 
subject: Making a .exe File.