views:

599

answers:

2

I want to redistribute tomcat as part of my application. I'll be distributing a bundled jre as well, and I need to have my app's installer a) install the tomcat service in windows and b) not have it use JAVA_HOME if it's already set on the machine. That is, I need tomcat to point to my bundled jre.

I read here that you can pass a command line parameter to tomcat6w.exe to change the jre that tomcat uses. Will this change persist even after stopping the tomcat service?

I also noticed that the tomcat service manager program stores its settings in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\Tomcat6\Parameters. Is it enough to change the Java\Jvm key to the jvm.dll of my bundled jre?

A: 

The change will persist. It makes the change to the registry - you can also use tomcat6w to do things like change memory arguments, catalina_home, catalina_base etc.

As far as just changing the key to the bundled jre - I haven't tried that. Let me know if that works? Thanks.

BZ
+1  A: 

The tomcat6.exe file that comes with the distribution has command line switches for doing all of this. It also comes with service.bat which does some of the work for you. I ended up modifying service.bat, passing in the --Jvm switch with the location of the jvm I wanted it to use.

jobrahms