You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2009/10/16 16:16:16 UTC
svn commit: r825905 - in
/incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts: runUimaClass.bat
runUimaClass.sh
Author: cwiklik
Date: Fri Oct 16 14:16:16 2009
New Revision: 825905
URL: http://svn.apache.org/viewvc?rev=825905&view=rev
Log:
UIMA-1531 Launch scripts that unify setup steps needed to run uima programs
Added:
incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.bat
incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.sh
Added: incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.bat
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.bat?rev=825905&view=auto
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.bat (added)
+++ incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.bat Fri Oct 16 14:16:16 2009
@@ -0,0 +1,53 @@
+@echo off
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+
+@if not defined UIMA_HOME (
+ @echo UIMA_HOME environment variable is not set
+ @exit /B 1
+)
+
+@setlocal
+
+@rem Set ActiveMQ home
+@if "%ACTIVEMQ_HOME%"=="" (set ACTIVEMQ_HOME=%UIMA_HOME%\apache-activemq-4.1.1)
+
+@if "%JAVA_HOME%"=="" (set UIMA_JAVA_CALL=java) else (set UIMA_JAVA_CALL=%JAVA_HOME%\bin\java)
+
+@rem Set jar search order of: UIMA_CLASSPATH uima activemq(optional) tomcat(optional) CLASSPATH
+@set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\examples\resources
+@set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib
+@if EXIST "%ACTIVEMQ_HOME%" (set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%ACTIVEMQ_HOME%;%ACTIVEMQ_HOME%\lib;%ACTIVEMQ_HOME%\lib\optional)
+@if NOT "%CATALINA_HOME%"=="" (set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib)
+@set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CLASSPATH%
+
+@rem Set path to support running C++ annotators
+@if "%UIMACPP_HOME%"=="" set UIMACPP_HOME=%UIMA_HOME%\uimacpp
+@set PATH=%UIMACPP_HOME%\bin;%UIMACPP_HOME%\examples\tutorial\src;%PATH%
+
+@rem Set VNS_HOST and VNS_PORT to default values if they are not specified
+@if "%VNS_HOST%"=="" set VNS_HOST=localhost
+@if "%VNS_PORT%"=="" set VNS_PORT=9000
+
+@rem Set default for logger properties
+@if "%UIMA_LOGGER_CONFIG_FILE%"=="" set UIMA_LOGGER_CONFIG_FILE=%UIMA_HOME%\config\Logger.properties
+
+@rem Set default JVM opts
+@set UIMA_JVM_OPTS=%UIMA_JVM_OPTS% -Xms128M -Xmx800M
+
+@rem Finally load the jars and run the class
+@"%UIMA_JAVA_CALL%" -DVNS_HOST=%VNS_HOST% -DVNS_PORT=%VNS_PORT% "-Duima.home=%UIMA_HOME%" "-Duima.datapath=%UIMA_DATAPATH%" "-Djava.util.logging.config.file=%UIMA_LOGGER_CONFIG_FILE%" %UIMA_JVM_OPTS% -DUimaBootstrapSuppressClassPathDisplay -Dorg.apache.uima.jarpath="%UIMA_CLASSPATH%" -jar "%UIMA_HOME%\lib\uimaj-bootstrap.jar" %*
Added: incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.sh
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.sh?rev=825905&view=auto
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.sh (added)
+++ incubator/uima/uimaj/trunk/uimaj-distr/src/main/scripts/runUimaClass.sh Fri Oct 16 14:16:16 2009
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+if [ "$UIMA_HOME" = "" ]
+then
+ echo UIMA_HOME environment variable is not set
+ exit 1
+fi
+
+# set default ActiveMQ home
+if [ "$ACTIVEMQ_HOME" = "" ]
+then
+ ACTIVEMQ_HOME=$UIMA_HOME/apache-activemq-4.1.1
+fi
+
+if [ "$JAVA_HOME" = "" ]
+then
+ UIMA_JAVA_CALL=java
+else
+ UIMA_JAVA_CALL="$JAVA_HOME/bin/java"
+fi
+
+#Set jar search order of: UIMA_CLASSPATH uima activemq(optional) tomcat(optional) CLASSPATH
+UIMA_CLASSPATH=$UIMA_CLASSPATH:$UIMA_HOME/examples/resources
+
+
+LOCAL_SAVED_UIMA_CLASSPATH=$UIMA_CLASSPATH
+UIMA_CLASSPATH=$UIMA_HOME/examples/resources
+UIMA_CLASSPATH=$UIMA_CLASSPATH:$UIMA_HOME/lib
+if [ -e $ACTIVEMQ_HOME ]
+then
+ UIMA_CLASSPATH=$UIMA_CLASSPATH:$ACTIVEMQ_HOME:$ACTIVEMQ_HOME/lib:$ACTIVEMQ_HOME/lib/optional
+fi
+
+# -n: true if string has non-zero length
+if [ -n $CATALINA_HOME ]
+then
+ UIMA_CLASSPATH=$UIMA_CLASSPATH:$CATALINA_HOME/webapps/axis/WEB-INF/lib
+fi
+
+UIMA_CLASSPATH=$UIMA_CLASSPATH:$CLASSPATH
+
+#set LD_LIBRARY_PATH to support running C++ annotators
+if [ "$UIMACPP_HOME" = "" ]
+then
+ UIMACPP_HOME=$UIMA_HOME/uimacpp
+fi
+
+export PATH=$UIMACPP_HOME/bin:$UIMACPP_HOME/examples/tutorial/src:$PATH
+
+export LD_LIBRARY_PATH=$UIMACPP_HOME/lib:$UIMACPP_HOME/examples/tutorial/src:$LD_LIBRARY_PATH
+#also set DYLD_LIBRARY_PATH, used by Mac OSX
+export DYLD_LIBRARY_PATH=$UIMACPP_HOME/lib:$UIMACPP_HOME/examples/tutorial/src:$DYLD_LIBRARY_PATH
+
+#also set default values for VNS_HOST and VNS_PORT
+if [ "$VNS_HOST" = "" ];
+then
+ VNS_HOST=localhost
+fi
+if [ "$VNS_PORT" = "" ];
+then
+ VNS_PORT=9000
+fi
+#also set default vlaue for UIMA_LOGGER_CONFIG_FILE
+if [ "$UIMA_LOGGER_CONFIG_FILE" = "" ]
+then
+ UIMA_LOGGER_CONFIG_FILE=$UIMA_HOME/config/Logger.properties
+fi
+#set default JVM opts
+UIMA_JVM_OPTS="$UIMA_JVM_OPTS -Xms128M -Xmx800M"
+
+# Finally load the jars and run the class
+"$UIMA_JAVA_CALL" -DVNS_HOST=$VNS_HOST -DVNS_PORT=$VNS_PORT "-Duima.home=$UIMA_HOME" "-Duima.datapath=$UIMA_DATAPATH" "-Djava.util.logging.config.file=$UIMA_LOGGER_CONFIG_FILE" $UIMA_JVM_OPTS -DUimaBootstrapSuppressClassPathDisplay -Dorg.apache.uima.jarpath="$UIMA_CLASSPATH" -jar "$UIMA_HOME/lib/uimaj-bootstrap.jar" $*
+