@echo off
set APPDIR=%~dp0
set CMD_LINE_ARGS=%1
shift
:getArgs
if " "%1" "==" "" " goto doneArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto getArgs
:doneArgs

if "%JAVA%"=="" set JAVA=java
if "%GEE_HOME%"=="" GOTO FIND
echo GEE_HOME is no longer used and will be ignored
:FIND
PUSHD %APPDIR%
cd ..
set GEE_HOME=%CD%
POPD

set LIB=%GEE_HOME%\lib

set GEE=%LIB%\gee-2.2.2.jar
set SOD=%LIB%\sod-3.2.7-SNAPSHOT.jar
set ETOPO10=%LIB%\etopo10-1.0.jar
set VMAP_PO_THINNED=%LIB%\vmap_po_thinned-1.0.jar
set DCWPO_BROWSE=%LIB%\dcwpo_browse-1.0.jar
set CLASSICS=%LIB%\classics-1.1.jar
set VECMATH=%LIB%\vecmath-1.3.1.jar
set J3DCORE=%LIB%\j3d-core-1.3.1.jar
set J3DCOREUTILS=%LIB%\j3d-core-utils-1.3.1.jar
set REGISTRY=%LIB%\registry-1.1.jar
set NACHOCALENDAR=%LIB%\nachocalendar-0.21_USC1.jar
set BAG=%LIB%\bag-0.1alpha.jar
set JLINE=%LIB%\jline-0.9.94.jar
set JING=%LIB%\jing-20091111.jar
set RNGCONV=%LIB%\rngconv-20030225.jar
set VECTORGRAPHICS2D=%LIB%\VectorGraphics2D-0.9.jar
set GRALCORE=%LIB%\gral-core-0.9.jar
set JETTYSERVLET=%LIB%\jetty-servlet-9.3.0.RC1.jar
set JSON=%LIB%\json-20140107.jar
set VELOCITYTOOLS=%LIB%\velocity-tools-2.0.jar
set JAVACSV=%LIB%\javacsv-2.0.jar
set FISSURESUTIL=%LIB%\fissuresUtil-1.1.11-SNAPSHOT.jar
set JSAP=%LIB%\jsap-2.1.jar
set JUNIT=%LIB%\junit-3.8.1.jar
set JETTYSECURITY=%LIB%\jetty-security-9.3.0.RC1.jar
set COMMONSBEANUTILS=%LIB%\commons-beanutils-1.7.0.jar
set COMMONSDIGESTER=%LIB%\commons-digester-1.8.jar
set COMMONSCHAIN=%LIB%\commons-chain-1.1.jar
set COMMONSVALIDATOR=%LIB%\commons-validator-1.3.1.jar
set ORO=%LIB%\oro-2.0.8.jar
set SSLEXT=%LIB%\sslext-1.2-0.jar
set FISSURESIMPL=%LIB%\fissuresImpl-1.1.22.jar
set SEISFILE=%LIB%\seisFile-1.7.3-SNAPSHOT.jar
set TAUP=%LIB%\TauP-2.4.1.jar
set OREGONDSP=%LIB%\oregondsp-2011.jar
set HIBERNATEEHCACHE=%LIB%\hibernate-ehcache-3.6.9.Final.jar
set HIBERNATECORE=%LIB%\hibernate-core-3.6.9.Final.jar
set JAVASSIST=%LIB%\javassist-3.12.1.GA.jar
set ISTIUTIL=%LIB%\isti.util-20120201.jar
set HSQLDB=%LIB%\hsqldb-1.8.0.10.jar
set POSTGRESQL=%LIB%\postgresql-9.4-1201-jdbc41.jar
set XERCESIMPL=%LIB%\xercesImpl-2.10.0.jar
set XALAN=%LIB%\xalan-2.7.1.jar
set OPENMAP=%LIB%\openmap-4.6.2.jar
set ITEXTPDF=%LIB%\itextpdf-5.1.3.jar
set JCOMMON=%LIB%\jcommon-1.0.0.jar
set JFREECHART=%LIB%\jfreechart-1.0.1.jar
set JAVAMAIL=%LIB%\javamail-1.3.2.jar
set ACTIVATION=%LIB%\activation-1.0.2.jar
set HIBERNATEC3P0=%LIB%\hibernate-c3p0-3.6.9.Final.jar
set JETTYSERVER=%LIB%\jetty-server-9.3.0.RC1.jar
set FISSURESIDL=%LIB%\fissuresIDL-1.0_getset_p2.jar
set SEEDCODEC=%LIB%\seedCodec-1.0.11.jar
set SLF4JAPI=%LIB%\slf4j-api-1.7.21.jar
set SLF4JLOG4J12=%LIB%\slf4j-log4j12-1.7.21.jar
set RXTX=%LIB%\rxtx-2.1.7.jar
set WOODSTOXCORELGPL=%LIB%\woodstox-core-lgpl-4.4.1.jar
set MSVCORE=%LIB%\msv-core-2013.6.1.jar
set HTTPCLIENT=%LIB%\httpclient-4.5.2.jar
set EHCACHECORE=%LIB%\ehcache-core-2.4.3.jar
set ANTLR=%LIB%\antlr-2.7.6.jar
set HIBERNATECOMMONSANNOTATIONS=%LIB%\hibernate-commons-annotations-3.2.0.Final.jar
set HIBERNATEJPA20API=%LIB%\hibernate-jpa-2.0-api-1.0.1.Final.jar
set JTA=%LIB%\jta-1.1.jar
set ISTIUTILTOPLEVEL=%LIB%\isti.util.toplevel-1.0USC.jar
set JDOM=%LIB%\jdom-b9.jar
set XMLAPIS=%LIB%\xml-apis-2.10.0.jar
set XMLRESOLVER=%LIB%\xml-resolver-1.2.jar
set SERIALIZER=%LIB%\serializer-2.10.0.jar
set SERIALIZER=%LIB%\serializer-2.7.1.jar
set C3P0=%LIB%\c3p0-0.9.1.jar
set JAVAXSERVLETAPI=%LIB%\javax.servlet-api-3.1.0.jar
set JETTYHTTP=%LIB%\jetty-http-9.3.0.RC1.jar
set JETTYIO=%LIB%\jetty-io-9.3.0.RC1.jar
set JACORB=%LIB%\jacorb-2.3.1_USC2.jar
set BACKPORTUTILCONCURRENT=%LIB%\backport-util-concurrent-2.3.1.jar
set LOG4J=%LIB%\log4j-1.2.17.jar
set STAXAPI=%LIB%\stax-api-1.0-2.jar
set STAX2API=%LIB%\stax2-api-3.1.4.jar
set XSDLIB=%LIB%\xsdlib-2013.6.1.jar
set ISORELAX=%LIB%\isorelax-20090621.jar
set HTTPCORE=%LIB%\httpcore-4.4.4.jar
set COMMONSCODEC=%LIB%\commons-codec-1.9.jar
set JETTYUTIL=%LIB%\jetty-util-9.3.0.RC1.jar
set RELAXNGDATATYPE=%LIB%\relaxngDatatype-20020414.jar
set VELOCITY=%LIB%\velocity-1.7.jar
set COMMONSLANG=%LIB%\commons-lang-2.4.jar
set COMMONSLOGGING=%LIB%\commons-logging-1.2.jar
set MYSQLCONNECTORJAVA=%LIB%\mysql-connector-java-5.1.39.jar
set COMMONSCOLLECTIONS=%LIB%\commons-collections-3.2.1.jar
set DOM4J=%LIB%\dom4j-1.6.1.jar


if EXIST "%GEE%" GOTO LIBEND
echo %GEE% doesn't exist
echo GEE requires this file to function.  It should be in the lib dir
echo parallel to the bin directory to this script in the filesystem.
echo If it seems like the lib dir is there, email sod@seis.sc.edu for help
GOTO END
:LIBEND
    
set CLASSPATH=%GEE%;%SOD%;%ETOPO10%;%VMAP_PO_THINNED%;%DCWPO_BROWSE%;%CLASSICS%;%VECMATH%;%J3DCORE%;%J3DCOREUTILS%;%REGISTRY%;%NACHOCALENDAR%;%BAG%;%JLINE%;%JING%;%RNGCONV%;%VECTORGRAPHICS2D%;%GRALCORE%;%JETTYSERVLET%;%JSON%;%VELOCITYTOOLS%;%JAVACSV%;%FISSURESUTIL%;%JSAP%;%JUNIT%;%JETTYSECURITY%;%COMMONSBEANUTILS%;%COMMONSDIGESTER%;%COMMONSCHAIN%;%COMMONSVALIDATOR%;%ORO%;%SSLEXT%;%FISSURESIMPL%;%SEISFILE%;%TAUP%;%OREGONDSP%;%HIBERNATEEHCACHE%;%HIBERNATECORE%;%JAVASSIST%;%ISTIUTIL%;%HSQLDB%;%POSTGRESQL%;%XERCESIMPL%;%XALAN%;%OPENMAP%;%ITEXTPDF%;%JCOMMON%;%JFREECHART%;%JAVAMAIL%;%ACTIVATION%;%HIBERNATEC3P0%;%JETTYSERVER%;%FISSURESIDL%;%SEEDCODEC%;%SLF4JAPI%;%SLF4JLOG4J12%;%RXTX%;%WOODSTOXCORELGPL%;%MSVCORE%;%HTTPCLIENT%;%EHCACHECORE%;%ANTLR%;%HIBERNATECOMMONSANNOTATIONS%;%HIBERNATEJPA20API%;%JTA%;%ISTIUTILTOPLEVEL%;%JDOM%;%XMLAPIS%;%XMLRESOLVER%;%SERIALIZER%;%SERIALIZER%;%C3P0%;%JAVAXSERVLETAPI%;%JETTYHTTP%;%JETTYIO%;%JACORB%;%BACKPORTUTILCONCURRENT%;%LOG4J%;%STAXAPI%;%STAX2API%;%XSDLIB%;%ISORELAX%;%HTTPCORE%;%COMMONSCODEC%;%JETTYUTIL%;%RELAXNGDATATYPE%;%VELOCITY%;%COMMONSLANG%;%COMMONSLOGGING%;%MYSQLCONNECTORJAVA%;%COMMONSCOLLECTIONS%;%DOM4J%

%JAVA% -classpath %CLASSPATH%   -Xmx512m -agentpath:$AGENTPATH  -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dswing.volatileImageBufferEnabled=false -Djava.endorsed.dirs=${LIB}/endorsed -Djacorb.connection.client.pending_reply_timeout=120000 -Djacorb.log.default.verbosity=2    edu.sc.seis.gee.Start  %CMD_LINE_ARGS%
:END
