Do I need to create a Java. exe file? Michael Geisler, Java expert in Builder Australia, analyzed several methods that developers can use in this article.
Problem
Hello, Michael:
I need to create a Java. exe file for my application. What are the steps required to create a Java. exe file? Is there any tool that can help me automatically create a Java. exe file?
Answer
The standard Java Development Kit (JDK) provided by Sun does not provide tools for creating platform-specific executable files (not surprisingly, this is true ). However, there are actually many ways to help you implement this idea.
Third-party tools
One way is to use third-party commercial tools or free tools to package Java applications into an executable file.
The following are two tools with different prices and features, but there are several other third-party tools on the Web that can be downloaded for free.
Http://www.bysoft.se/sureshot/exej/
Http://www.duckware.com/jexepack/
Use commercial installer)
InstallAnywhere is a common installation program that manages the installation process of applications and packages the applications as executable programs.
Use. jar
In addition to the preceding methods, you can package an application into an executable. jar file instead of A. exe file. I will not detail this method in this article. You can find a great online tutorial here.
The most important thing you need to do is to specify which class is the entry point of the application in the. jar file. For example, your application is guided by a public static void main (String [] args) method. You can provide this information in the. jar file's Main-Class header information. The general form of this header information is: Main-Class: classname, where classname is the Class name of the entry point of the application.
Use Java Webstart
Java Webstart is a hidden treasure of the standard Java Runtime Environment (JRE). Since version 1.3, JRE includes Java Webstart. It is a simple, powerful, and flexible way to deploy applications on any platform.
Webstart allows application users to start and manage applications from their browsers, emails, or desktops. One of the main advantages of Java Webstart is that once an application is installed, it will check whether the user is running the latest version of the application every time it starts. If not, the application will load the new version to the desktop and then execute it over the network, thus solving the software propagation problem.
This is especially important if your application already has many users. It can also be important to check the user's local desktop environment and ensure that they have installed the correct JRE version to run your application.
Java Webstart has a series of articles, so I suggest you visit the Java Webstart Web site to view more documents and tutorials.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.