This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one for details.
Java applications usually start by batch files or shell scripts which among other things set the executable java from the JRE_HOME or JAVA_HOME or the PATH environment variables. What are the best practices in writing such scripts and setting the PATH and JRE_HOME and JAVA_HOME considering the following factors:
-security -convenience for average end users -multiple versions of JRE/JDK in the same machine
Should we find 'java' from the PATH, JRE_HOME or JAVA_HOME?
JAVA_HOME should be set to the home folder of your JDK - typically C:\jdk1.6.0_05 (or whatever version and wherever you installed it).
JRE_HOME is hardly ever needed - I've never ever set it before.
PATH should include "%JAVA_HOME%\bin" for Windows or $JAVA_HOME/bin for Linux / Unix / ... Depending on whether or not JAVA_HOME contains any spaces you'd want to put the entire path, including the \bin, in quotes.