views:

587

answers:

2

I have a java batch file consisting of 4 execution steps written for analyzing any Java application. In one of the steps, I'm adding few libs in classpath that are needed for my core application to run. If any of Java applications that I'm analyzing need specific jars, then how do I add them in the classpath mentioned in the batch file. Can this be done using JavaScripts ?

A: 

I would say that you should have those core JARs available in the CLASSPATH of the script on start-up. I can't see why you'd want to repeatedly fetch those JARs and put them somewhere again and again.

Put those JARs in a/lib directory as part of your core app, add them to CLASSPATH in the script, and be done with it would be my advice.

duffymo
I'll be adding jars depending on those applications which I'm anayzing. I'll be taking this info from UI and have to include them in classpath
"batch job" usually means no UI to me. I'm sure other people reading your question will be equally confused.
duffymo
UI is developed to give input application code, any external libs etc. once these parameters are given, then I run the batch application
A: 

Just add them up front. The JVM loads them lazy-ly anyway. Also have a look here on the options how. (Also the comments)

tcurdt