Jar-to-EXE and EXE-package authoring with Java environment

Source: Internet
Author: User

It's really hard to get a name that sums up all the content of this blog.


Java is a magical language that can be said to be used everywhere as a learning

Java can be used to develop mobile PC desktop Terminal Server Web front end program

The other 3 areas of Java are well developed, but the PC desktop side almost no one to use, why?


The reason is simple, the Java leader brain is eaten by zombies

For a simple chestnut, I use Eclipse to export a runable Jar to the desktop, double-click Incredibly unable to execute, I wipe.

To tell you the truth, I didn't know it was going to be six months later. Execute java-jar xxx with Windows command line to start the executable jar program, you say the egg does not hurt, when installing JDK Why do not associate jar with the default program execution, if there is no executable class, pop up a dialog box, so that at least I can easily make a jar program that can be executed under Windows, or the JDK contains a tool that packs a jar into an EXE.


Later I have studied, Jar to EXE is not non-line, need to rely on a few third-party tools, let me live the whole process of making a Jar into a Windows installation package (including JRE):

Preparation tools:

    • 1.7ZIP Click to open link http://pan.baidu.com/s/1mg1d0Ru
    • 2.EXE4J Click to open the link Http://pan.baidu.com/s/1o6DQBEU

The artifact that makes the jar launcher can solve the JRE dependency problem

    • 3.inno_setup Click to open the link http://pan.baidu.com/s/1qW0pvek

For Windows Installer package authoring

    • 4.JDK 1.7 32-bit Click to open the link http://pan.baidu.com/s/1mgurP00


First step: Export jar
    • Installing the JDK (installed abuse)
    • Export runable jar I'm using eclipse right-click

Step Two:to make a jar starter program,1. Configure the EXE4J environment variables,

exe4j_java_home Executing the bin directory of the JRE, note that it is not the same as the general JAVA environment variable

2. Unzip the exe4j and run the Exe4j.exe in the bin directory

If the run fails, try moving to another disk (not in Chinese in the main directory path), or your first-step environment variable is not paired

The use of 3.exe4j, illustrated by:

    • A: Registration exe4j can use the following registration code:

user name and company name can be easily filled
A-xvk258563f-1p4lv7mg7sav
A-xvk209982f-1y0i3h4ywx2h1
A-xvk267351f-dpurrhnyarva


    • B. Configuring the Path

    • Select the jar to encapsulate:

    • Configuring the JRE

    • Configuring the splash Screen

    • Done:

So the jar startup program is finished, if EXE failed to start, try to change a 32-bit computer, I 64win 8.1 exported exe run, prompt error code 16, can not find the reason, and later changed the 32-bit XP all normal


Step three: Make EXE installation package

This is a good program is a lot of files and folders, the JRE extracted more than 100 m, so to others use is obviously not professional, let's make an installation package it,

Tools used: Inno_setup As for such tools how to use someone more professional than I write, I don't repeat, look at the following blog

Click the Open link http://robert-liu.iteye.com/blog/890165

However, I would like to mention: when selecting a folder, he will extract the folder to the root directory, such as I choose the ADB folder, the installation will be all the files under the ADB extracted to the program installation directory, rather than the installation directory/adb directory, the solution is to modify the script itself, very simple, Put a picture to believe you should read:



Jar-to-EXE and EXE-package authoring with Java environment

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.