@echo off

set OLDCLASSPATH=%CLASSPATH%
set OLDPATH=%PATH%

if not "%JAVA_HOME%" == "" if exist "%JAVA_HOME%\bin" goto gotJavaHome
set JAVA_HOME=C:\Java\jdk1.5.0_02
set PATH=%JAVA_HOME%\bin;%PATH%

if not "%JAVA_HOME%" == "" if exist "%JAVA_HOME%\bin" goto gotJavaHome
echo JAVA HOME set to %JAVA_HOME%
echo ERROR: JAVA_HOME not set correctly. Edit this script and set JAVA_HOME to point at your Java Development Kit installation
goto error

:gotJavaHome
echo JAVA HOME set to %JAVA_HOME%
if exist "%JAVA_HOME%\lib\tools.jar" goto okTools
echo ERROR: Unable to locate tools.jar.
goto error
:okTools

set CLASSPATH=
set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CLASSPATH%;..\bin\abalib.jar
set CLASSPATH=%CLASSPATH%;..\bin\abadc.jar
set CLASSPATH=%CLASSPATH%;..\bin\EXML.jar
set CLASSPATH=%CLASSPATH%;..\bin\cf.jar
set CLASSPATH=%CLASSPATH%;..\bin\cbeans.jar
set CLASSPATH=%CLASSPATH%;..\bin\cutils.jar
set CLASSPATH=%CLASSPATH%;..\bin\ozten.jar
set CLASSPATH=%CLASSPATH%;..\bin\rowset.jar
set CLASSPATH=%CLASSPATH%;..\bin\swingset-bin_0.7.0_beta.jar
set CLASSPATH=%CLASSPATH%;..\bin\mysql-connector-3.0.14.jar
set CLASSPATH=%CLASSPATH%;..\bin\janino.jar
set CLASSPATH=%CLASSPATH%;..\bin\looks-1.1.3.jar
set CLASSPATH=%CLASSPATH%;..\bin\mssqlserver.jar;..\bin\msbase.jar;..\bin\msutil.jar
set CLASSPATH=%CLASSPATH%;..\bin\customcomponents\abaguicustom.jar
set CLASSPATH=%CLASSPATH%;..\bin\customcomponents\dev.customcomponents.AbacusCostum.jar
set CLASSPATH=%CLASSPATH%;..\bin\customcomponents\jcommon-1.0.0-pre2.jar
set CLASSPATH=%CLASSPATH%;..\bin\customcomponents\jfreechart-1.0.0-pre2.jar
set CLASSPATH=%CLASSPATH%;.

@echo on
"%JAVA_HOME%\bin\javac" %1
IF NOT ERRORLEVEL 1 GOTO end

:error
pause

:end
set CLASSPATH=%OLDCLASSPATH%
set PATH=%OLDPATH%

