Windows exe launcher for Java app with JRE check

匿名 (未验证) 提交于 2019-12-03 02:20:02

问题:

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

  1. if the required JRE isn't installed, show a window with a proper link.
  2. 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/



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!