Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: java.home problem


Message #1 by "Darragh O'Brien" <darragh@g...> on Wed, 28 Mar 2001 17:40:23 +0100
I think it's because the two 'home's are different.

One is an environment variable used by Windows to determine a path.  In a
batch file then, you can use the %JAVA_HOME% variable, instead of typing out
c:\jdk1.2 every time (a dubious savings in letters typed). As for the other
advantage of variables... if you change the JAVA_HOME variable once, you do
not need to rewrite x scripts, where x is the number of scripts that use
JAVA_HOME. :)

But within the world of a running Java program, 'home' would mean the
directory of the JVM, which is the JRE. But if you know that the JRE is
always under %JAVA_HOME%\JRE, you can use string manipulation to chop off
the \JRE, and voila, JAVA_HOME is yours.



  Return to Index