Create Windows Installer for Java Programs

2019-01-08 10:07发布

问题:

I'm a Java beginner.

I already created a simple GUI application that display will "hello world" label.

But, how can I create an installer from .java or .jar for windows. Let's say that I have created a useful application and want to share it with my friends to install it in their PC without they need to know what is JRE, or how to download JRE.

回答1:

Deploy the app. from a web site using Java Web Start. Ensure the user has the minimum Java using deployJava.js (linked from the JWS info page).



回答2:

http://java-source.net/open-source/installer-generators
A little googling does simple miracles.



回答3:

You can use WiX to create Windows Installer package. The package will include the JRE binaries and your compiled application (jar file). Upon installation, the installer unpacks your files to user's computer, creates shortcut that starts your application (app-path\jre\bin\javaw.exe -jar app-path\your-app.jar).

See notes on Redistributing the JRE and in README.



回答4:

You can use either NSIS or Inno Setup



回答5:

I use a program called JSmooth. This turns java .jar files into executables. I then take those executable and create a installer using InstallShield. InstallShield allows you to create highly customizable installers. There is a free "Light Edition" that you can use. Very easy to do and very easy to add to build scripts.



回答6:

You can use Ant task tool with InnoSetup and Launch4j under Eclipse IDE to create a professional-looking Windows-based EXE installer for Java-based program: How to create an exe file in java



回答7:

You can use the install4j for the create exe file for jar file of java project and use the Inno Setup Compiler file for create the installer for the project. this ts Youtube vedio for the how to create the exe and installer

video for create the exe and installer



回答8:

Basically, you have to save your project in jar and then convert to exe, you can use jar4exe or other software. When you have the exe file, use an installer software like Inno Setup Compile or other. After all those stpes Your project will be ready to be install in windows, mac or linux platform. Good Luck.



回答9:

  1. Install exe4j

    • This you will use to create a .exe file from a jar file
  2. Install inno setup compiler

    • This is used to create installer

An outdated but relevant video to guide you through https://www.youtube.com/watch?v=kSmhIunxVW4