@echo off

:TEST
REM echo MINT_HOME = %MINT_HOME%
if "%MINT_HOME%"=="" goto ERROR4
::Test the batch path to see if "My.jar" is there.
if not exist "%MINT_HOME%\langtools\dist\lib\classes.jar" goto ERROR2
for %%P in (%PATH%) do if exist %%P\java.exe goto JAVAFOUND
goto ERROR3

:JAVAFOUND
java -Xbootclasspath/p:"%MINT_HOME%\langtools\dist\lib\classes.jar" edu.rice.cs.mint.comp.com.sun.tools.javac.Main %1 %2 %3 %4 %5 %6 %7 %8 %9

goto DONE

:ERROR
echo Error: Please start the Mint compiler using the following command line:
echo ""
echo java -Xbootclasspath/p:classes.jar edu.rice.cs.mint.comp.com.sun.tools.javac.Main MyClass.java
echo ""
echo where: classes.jar is the classes.jar file in the langtools/dist/lib
echo        directory.
echo where: MyClass.java is the file to compile.
goto DONE

:ERROR2
echo Error: Could not find the classes.jar file. Please rebuild Mint.
goto DONE

:ERROR3
echo Error: java.exe was not found on the PATH. Please add its path to the
echo        PATH environment variable.
goto DONE

:ERROR4
echo Error: Please set the MINT_HOME environment variable correctly.
goto DONE

:DONE

