]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Use JAVA_HOME environment variable if it is available.
authorJeremias Maerki <jeremias@apache.org>
Sun, 23 Apr 2006 14:45:17 +0000 (14:45 +0000)
committerJeremias Maerki <jeremias@apache.org>
Sun, 23 Apr 2006 14:45:17 +0000 (14:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@396279 13f79535-47bb-0310-9956-ffa450edef68

fop.bat

diff --git a/fop.bat b/fop.bat
index c6b66fb60e29dd1cdc9a3de87ff4ee97cf22192c..357ffb4fdc6d23f3c12562a491e63530a63583a5 100644 (file)
--- a/fop.bat
+++ b/fop.bat
@@ -56,5 +56,15 @@ set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar
 set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\fop-hyph.jar\r
 set LOCALCLASSPATH=%LOCALCLASSPATH%;%FOP_HYPHENATION_PATH%\r
 \r
-java %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%\r
+if "%JAVA_HOME%" == "" goto noJavaHome\r
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome\r
+if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java\r
+goto runFop\r
+\r
+:noJavaHome\r
+if "%JAVACMD%" == "" set JAVACMD=java\r
+\r
+:runFop\r
+ECHO "%JAVACMD%"\r
+"%JAVACMD%" %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%\r
 \r