This week I had a requirement for scripting the installation of the Java 5 JDK and JRE. These instructions require separate install files for the JDK and JRE but will get the job done.
For the JDK, you can place the following in a *.bat file and simply run it from command line:
For the JRE:
Some related links: