Permalink
Browse files

Modifying the start script templates to look for an optional setenv.sh

file that might contain environmental variable settings
  • Loading branch information...
1 parent f5582be commit c1a90138416ea38dd4161cada47f3e27cc45098c @dlandis committed Mar 30, 2012
@@ -67,6 +67,13 @@ cd "\$SAVED"
CLASSPATH=$classpath
+# Check if a script for setting environmental variables exists
+if [ -r "$APP_HOME/bin/setenv.sh" ]; then
+ . "$APP_HOME/bin/setenv.sh"
+elif [ -r "$APP_HOME/setenv.sh" ]; then
+ . "$APP_HOME/setenv.sh"
+fi
+
# Determine the Java command to use to start the JVM.
if [ -n "\$JAVA_HOME" ] ; then
if [ -x "\$JAVA_HOME/jre/sh/java" ] ; then
@@ -72,6 +72,14 @@ set CMD_LINE_ARGS=%\$
set CLASSPATH=$classpath
+@rem Check if a script for setting environmental variables exists
+if not exist "%APP_HOME%\bin\setenv.bat" goto checkSetenvHome
+call "%APP_HOME%\bin\setenv.bat"
+goto setenvDone
+:checkSetenvHome
+if exist "%APP_HOME%\setenv.bat" call "%APP_HOME%\setenv.bat"
+:setenvDone
+
@rem Execute ${applicationName}
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %${optsEnvironmentVar}% <% if ( appNameSystemProperty ) { %>"-D${appNameSystemProperty}=%APP_BASE_NAME%"<% } %> -classpath "%CLASSPATH%" ${mainClassName} %CMD_LINE_ARGS%

0 comments on commit c1a9013

Please sign in to comment.