Friday, September 18, 2009

Cross-platform java executable wrapper

Early this year I needed to wrap a small project java swing app into a native MS-OS executable, after deliberating on few products out there I chose launch4j Resolution: It did the job, it has easy to use streamlined UI which generates an xml configuration file which then you can reuse to rebuild exe. Below is an example configuration I used, take it as a guideline and modify accordingly for your needs. Cheers!



true
gui
lib\org.myapp_1_0_0.jar
C:\tmp\MyApp.exe
Java Runtime Error
config/log4j.xml config/config.xml
.
normal
http://java.com/download
http://java.sun.com
false
false

icon.ico

MyApp
MyApp


org.myns.myproj.MyAppMain
lib/org.myapp_1_0_0.jar
lib/commons-collections-3.1.jar
lib/commons-io-1.4.jar
lib/commons-lang.jar
lib/commons-logging-1.1.jar



C:\Program Files\Java\jre6
1.6.0_11

preferJre
128
256


img\logo.bmp
true
60
true


An error occurred while starting the application.
This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.
This application requires a Java Runtime Environment
The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted.
An application instance is already running.


1 comments:

Anonymous said...

Martín: no entiendo una mierda de tu post...pero aprovecho para saludarte...tanto tiempo
Fabio Seleme
fe-seleme@uolsinectis.com.ar
Un abrazo