Dynamic Classpath for Batch File
From Hapi, a great way to set the classpath for a batch file:
@echo off for %%I IN (..\lib\*.jar) DO SET CP=!CP!;%%I java -cp %CP% com.example.Launcher
And also for shell scripts:
#! /bin/bash CP="." for i in ../lib/*.jar; do CP=$i:$CP; done java -cp $CP com.example.Launcher
About this entry
You’re currently reading “Dynamic Classpath for Batch File,” an entry on Elegando
- Published:
- 06.29.11 / 9pm
- Category:
- General
Comments