Hi,
How can I convert my java program to an .exe file ?
What is the best way for doing this?
Printable View
Hi,
How can I convert my java program to an .exe file ?
What is the best way for doing this?
The standard Java development kit (JDK) supplied by Sun does not provide a tool to create platform specific executables (This is not suprising really). However, you do have a number of options to choose from that will help you get this done.
Third-party tools
One option is to use a third-party commercial or free tool to package your Java application as an executable file.
Use .jar
As an alternative, you may want to bundle your application as an executable .jar file instead of a .exe file.
The essential thing you need to do is indicate which class within the .jar file is your application's entry point. For example, the bootstrap class for your application with a public static void main(String[] args) method. You can provide this information with the Main-Class header in the .jar manifest file. This header has the general form: Main-Class: classname ,where the value classname is the name of the class that is your application's entry point.
Use Java Webstart.
Java Webstart is one of the hidden gems of the standard Java runtime environment (JRE), and has been included with the JRE since version 1.3. It is a simple, but powerful and flexible way of deploying applications to any platform.
Webstart allows users of your application to launch and manage the application from their browser, e-mail or desktop. One of the key advantages of Java Webstart is that once the application is installed, everytime you start it, it will check to see if the user is running the latest version of the application. If not, the app will load and execute a new version over the network to the desktop and thus eradicates software currency issues.
This is particularly important if you have many users of your application. Importantly it also checks the local desktop environment of the user and will ensure that they have the appropriate version of the JRE installed to run your application.
In java, we also can create executable file like in vb6...but it's file extension is not .exe...it's extension is .jar....we can run it by double click on it like we run .exe file
HOW TO CREATE JAR USING COMMAND PROMPT :
http://www.youtube.com/watch?v=vK-gYDtsr58
FROM JAR TO EXE :
http://www.youtube.com/watch?v=CMEmT9lnb9w
EASIEST WAY HOW TO CREATE JAR FILE ( JAVA EXECUTABLE FILE ):
http://www.youtube.com/watch?v=kBzEHKXly0k
For more understanding please refer to these topics:
http://www.javalobby.org/articles/java2exe/
http://www.excelsior-usa.com/articles/java-to-exe.html.
I hope this helps you!