JAVA project export, exe packaging and installation file making __java

Source: Internet
Author: User
1. Java Project exported as jar file 1.1 Export with eclips features

This way a lot of tutorials online, do not make a narrative here. Let's just say the downside of this approach is that you can only export Java source files (preferably), and if there are many resource files in your project it's really a hassle. If the project introduces a large number of Third-party jar packages, the need to export the configuration file, although it can be implemented, but complex.
This is achieved with the Fat jar plug-in. 1.2 use plug-in fat jar to play Java project 1.2.1 Install fat Jar

A. Install a new file using the "Help"-> "Software Updates" in Eclips, where
Name: Any bar
Url:http://kurucz-grafika.de/fatjar
Or search for the search installation Fatjatr in Myeclips "Help"-> "eclips marketplace".
It is recommended to use this method.
B. Offline Download installation package installation
Fat-jar It is an open source tool under sourceforge.net from the Http://sourceforge.net/projects/fjep address can download the tool, download is completed after a zip compression package, After decompression, copy the net.sf.fjep.fatjar_0.0.27 folder under the Plugins folder to the Dropins folder under the Myeclipse8.5 or 8.x directory (for example, I use Myeclipse8.5, which is in C:\ Users\administrator\appdata\local\genuitec\myeclipse 8.5\dropins), and then directly start the MyEclipse right-click Project, you will find that the project has been integrated with the plugin after startup Right-click the project to see the options for the build Fat jar installed successfully or, clicking the Preferences option in the Windows Options bar, you can see that the Fat Jar preferences option indicates a successful installation. 1.2.2 using fat jar to export Java packages

Basic tutorials on the web is also a lot, I just talk about the problems I encountered:
The plugin can export the source files, resource files, and third parties under the SRC file into a jar file. However, the files under project that you use in your project are not exported, as shown in the following illustration:

Note:
A) But the following resource file procedures are also used when executing, how to do. By placing these files in the same sibling directory as the exported jar file, you can run them.
(b) Access to the resource file path under the src file in the program is generally: src\ corpus. txt ", but it was written so that the path could not be found when the export jar package was executed.

BufferedReader br = new BufferedReader (new InputStreamReader (
                this.getclass (). getResourceAsStream ("/Corpus txt"));

in addition,
If you double-click the jar file directly to execute and the error message is not visible, you can run the program at the command line by executing the following code in the jar file directory:

Java-jar Xxxx.jar
2. Convert jar file to executable exe file

Use the most common exe4j software; The basic tutorials are available online, not to mention. Or to say the problem encountered: Install the software needs to input license, otherwise there will be problems. See figure below:
Need to configure the Exe4j_java_home environment variable, the value is the JRE directory, note must be 32-bit JRE OH. 3. Make installation files

In this use Inno setup software, download, install, basic tutorials online.
Because I am under the English version, the choice of language when there is no Simplified Chinese, so downloaded a language pack CHINESESIMPLIFIED.ISL.
Put it under the files in the installation directory, and in the generated script file, change the language configuration as follows

[Languages]  

Run again.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.