Re: Calling a .bat file from a java program******
Can anyone provide me some hints on calling a "*.bat" file from a
java program.I have a .bat file, in which I am calling another third
party java class which is there in a jar file.
Why not call the class directly from Java code?
Simply ensure the class is on the classpath of
the first application, then..
I need to call this ... from another java program and provide
the three parameters at run time.
..the class can be loaded by importing it and
creating an instance.
Other strategies (assuming the second jar is not on
the original app's classpath) are to use an URLClassLoader,
pointing to the new Jar.
If all else fails (class not in Jar/in default package/
not known till after start-up), you might need to
'stoop' to using reflection - in order to load it.
Capitalise the first letter of every sentence and
question, and also exclude '*' characters from
the subject line, as they might be mistaken for
(edited) swear words.
Message posted via JavaKB.com