Bug 56829 - do not override _RUNJAVA and _RUNJDB environment variables if already defined
Summary: do not override _RUNJAVA and _RUNJDB environment variables if already defined
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.41
Hardware: All All
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2014-08-08 11:45 UTC by Neeme Praks
Modified: 2014-09-30 13:32 UTC (History)
0 users

patch (1.34 KB, text/plain)
2014-08-08 11:45 UTC, Neeme Praks

Note You need to log in before you can comment on or make changes to this bug.
Description Neeme Praks 2014-08-08 11:45:10 UTC
Created attachment 31888 [details]

I'm integrating LiveRebel (http://liverebel.com) with Tomcat. I need a clean way how to get Tomcat scripts to start LiveRebel agent instead of Tomcat (the agent will be responsible for starting Tomcat).

Currently we are patching Tomcat scripts (catalina.sh/bat and setclasspath.sh/bat); however, that is messy, as every time user updates Tomcat, those changes get overwritten.

Instead, I would like to change the "java" executable that Tomcat scripts use to start Tomcat.

My current solution is to set _RUNJAVA environment variable in CATALINA_BASE/bin/setenv.sh/bat and then patch CATALINA_HOME/bin/setclasspath.sh/bat not to override the setting if already set (see the attached patch).
This solution is also described here:
Comment 1 Mark Thomas 2014-08-11 21:35:21 UTC
Fixed in 8.0.x for 8.0.11 onwards and in 7.0.x for 7.0.56 onwards.

I modified the patch slightly so setclasspath.sh handled java and jdb separately.

The modified patch has been proposed for 6.0.x.
Comment 2 Mark Thomas 2014-09-30 13:32:32 UTC
This has been fixed in 6.0.x for 6.0.42 onwards.