I make an installer with izpack. Its in .jar file. I want to make it in .exe file in order to distribute it. How can I do it in an easy way?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Andrew always likes to promote Java Web Start technology from the start :) It is a nice tech. But, you also need to learn the technical parts first before you can start tinkering with it.
Otherwise, you are left with the old-style EXE distribution model as follows...
I am not familiar with Izpack anyway. But, there are similar separate tools to achieve the combined result as to what izPack can do. My favorite EXE creation and installer tools are Launch4J + InnoSetup + Ant task running from Eclipse IDE.
Launch4J is a Java app launcher. InnoSetup is an installation creator Ant task helps developers on build and integration steps.
How to use Launch4J + InnoSetup + Ant build task + Eclipse IDE: http://www.eteks.com/tips/tipCreationExe.html (in French - use Google translate)
When you are thinking of distributing a desktop-based Windows EXE file for a Java app, you also need to think about the target environment. It is fine when you are targeting Windows XP or lesser version. But, it will start to be a major frustration when you want to make it work properly under Windows Vista and Windows 7.
It is best not to store application configurations, temporary files, etc. that require saving into
%ProgramFiles%
under Windows Vista/Windows 7 as it now becomes a read-only folder. Use user's profile folder for such purpose.Of course, you can bypass it by running your app with "Run as Administrator" but it involves the following setup:
How to solve the following issues:
(1) Issue with
AppUserModelID
Java support in Windows Vista/Windows 7 needs the following solution: Launch4j, NSIS, and duplicate pinned Windows 7 taskbar icons(2) Issue with
Run as Administrator
for a Java app needs the following solution: Request admin privileges for Java app on Windows VistaOther than those, you also need to check on
%ProgramFiles%
when running under 64-bit Windows version. The path is not the same between 32-bit Windows and 64-bit Windows. Under 64-bit Windows, all 32-bit apps will go into%ProgramFiles(x86)%
.So, be careful when using the hard-coded file path value to your Java app's folder and sub-folders that are installed in
%ProgramFiles%
. It is better to set up aWindows environment variable
which can be generated by InnoSetup in the following ISS file snippet. Use JavaSystem.getenv("MYAPP_HOME")
to retrieve the variable:Experiment and enjoy!
If the app. has a GUI and you can distribute from a web site, Java Web Start offers the best solution. JWS works for all platforms that support Java, and is supported by Oracle.
(I hear that .Net works well for 'Windows only' solutions.)
winrun4j is very easy to use, my only issue with it is that unless you are distributing with an embedded JVM you'll probably have to provide both a 64bit and a 32bit download.