@echo off
setlocal

set dist=%~dp0

set jars=%dist%\xerces.jar;%dist%\resolver.jar;%dist%\relaxng.jar;%dist%\xsc.jar;%dist%\jh.jar;%dist%\saxon.jar

if exist "%dist%\xxe.jar" goto jar
set cp=%dist%\..\class;%jars%
goto fi
:jar
set cp=%dist%\xxe.jar;%jars%;%dist%\xxe_help.jar
:fi

if exist "%dist%\jre\bin\javaw.exe" goto privatejre
set java=javaw
goto fi2
:privatejre
set java=%dist%\jre\bin\javaw.exe
:fi2

rem --------------------------------------------------------------------------
rem Notes about the Java[tm] command line:
rem
rem * Replace 'start "" /b "%java%"' by 'start java' if you need to see 
rem   Java exception stack traces and other low-level error messages 
rem   printed on the console.
rem 
rem * -Xss4m is needed to support large schemas.
rem   -Xmx512m is needed because more and more users tend to open in
rem    XXE large documents containing a lot of images.
rem 
rem * Add -Dsun.java2d.d3d=false as workaround for possible 
rem   display driver bugs.
rem --------------------------------------------------------------------------

start "" /b "%java%" -Xss4m -Xmx512m -DXXE_GUI="%XXE_GUI%" -DXXE_ADDON_PATH="%XXE_ADDON_PATH%" -DXXE_USER_PREFERENCES="%XXE_USER_PREFERENCES%" -classpath "%cp%" com.xmlmind.xmleditapp.start.Start %*

endlocal
