I have a simple Java web application using HSQLDB embedded database. The application is packaged as a simple war file. part of the requirement is to develop an application installer, that will:
- Installs TOMCAT
- resolves port conflicts (if any)
- Deploys the war
- Creates a shortcut that starts the service and launch the browser
I will also need to do this for both MAC and Windows, Any Ideas on how i can achieve this?
The problem looks very simple to me. Solution:
Do not rely on the target system having/not having JRE. Have a compatible JRE packaged with your application installer and forcefully install it (I’ve had compatibility issues).
In the installer, you should have the installer for the database application (if required), the JRE folder and the tomcat folder with the war file already in place. Just zip/tar these things together and unzip/untar them during installation.
Set the
CATALINA_HOMEvariable to your tomcat folder as a system variable.Set the
JRE_HOMEand appendPATHwith yourJREfolder andJRE/binfolderrespectively in the same session in which you start tomcat. This forces tomcat
to pick your JRE version and does not disturb any other application running on
the JVM.