If I have more than one version of Java installed can I specify the version I want to kick a program off with via batch file, or do I have to change my environment variable? If
If your batch file executes the Java program as:
java com.stackexchange.MyProgram argument1 argument2 etc
You can change it to execute it using a specific Java installation as:
"C:\Program Files\Java\jdk1.6.0_20\bin\java.exe" com.stackexchange.MyProgram argument1 argument2 etc
Or you can declare a variable and use it (this is useful if you have a master batch file that sets up the environment for your mini batch files):
:: In master batch ::
SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_20\bin
:: In mini batch ::
"%JAVA_HOME%\java.exe" com.stackexchange.MyProgram argument1 argument2 etc