Skip to content

Instantly share code, notes, and snippets.

@mmazer
Created April 17, 2013 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmazer/5404215 to your computer and use it in GitHub Desktop.
Save mmazer/5404215 to your computer and use it in GitHub Desktop.
Java - Windows batch file wrapper to start apps
@echo off
set TOP=%~dp0..
set LIB=%TOP%\lib
set MAIN=
for /R %LIB% %%a in (*.jar) do call :AddToPath %%a
set CLASSPATH=%CLASSPATH%;%LIB%\classes
java -classpath %CLASSPATH% %MAIN% %*
goto Done
:AddToPath
set CLASSPATH=%1;%CLASSPATH%
goto :EOF
:Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment