问题
I need to distribute a Java application and I want an installer to install it in all cases.
I need to create an *.exe
launcher that will check the installed JREs and
- if the required JRE isn't installed, show a window with a proper link.
- if required JRE is installed, launch the properly executable jar file.
回答1:
I'm pretty happy with WinRun4J: http://winrun4j.sourceforge.net/
It's under active development and some improvements I suggested were quickly implemented.
The only thing that is currently lacking (from my point of view) is to specify a "relative" path to the JRE to allow bundling a JRE with the application.
To spare you the effort of reading the manual, this is what I do for my launcher:
Rename WinRun4j.exe
to MyApp.exe
, then:
rcedit /C MyApp.exe
rcedit /I MyApp.exe myapp.ico
rcedit /N MyApp.exe MyApp.ini
Put into a nice little batch file and there is no "manual" stuff to do.
You only need to do this once (and if your library path changes)
回答2:
You could use JSmooth for example: http://jsmooth.sourceforge.net/
来源:https://stackoverflow.com/questions/15409490/windows-exe-launcher-for-java-app-with-jre-check