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.
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).
http://java-source.net/open-source/installer-generators
A little googling does simple miracles.
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.
You can use either NSIS or Inno Setup
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.
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
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
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.
Install exe4j
- This you will use to create a .exe file from a jar file
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