posted 19 years ago
Do you mean that you want to dynamically set up the CLASSPATH based on the JARs in a particular directory? I'm certain I can do this in Linux with a bash script, but I'm not sure about the details in a Windows batch file. The process should be similar; it's the syntax that I don't know exactly. Anyways, here is what I would do in bash:
1) Capture the name of the files in the directory. In bash, I can capture the output of "ls" into a variable for later use. Windows batch files may provide something similar, except you use "dir" instead of "ls".
2) Use the variable above to fill in the -classpath flag for "java" and/or "javac"
It might not even be this complicated now that I think about it. You might be able to specify the classpath using glob matching:
javac -classpath c:\mydir\*.jar
HTH
-Layne
Disclaimer: No warranty explicit or implied is granted for using the above suggestions.