I'm reading "Agile Java" by Jeff Langr. In the 'Setting Up' chapter I was to set JAVA_HOME env. var. to point to my Java dir. which I think I succeeded at doing properly. Then he instructs me to "try executing (under Windows): "%JAVA_HOME%"\bin\java -version". I don't know how to do what he says to do.
For Windows XP... - Click on the Start button (in the lower left of your screen by default). - Click on All Programs - Click on Accessories - Click on Command Prompt - In the window that come up, type the following (with the quotes):
"%JAVA_HOME%/bin/java" -version
In other versions of Windows, the Command Prompt mught be named "DOS Prompt" or something similar.
Ryan [ May 10, 2005: Message edited by: Ryan McGuire ]
I'm still confused. Earlier in the book, I was asked to verify Java config by typing "java -version" at the command prompt. This worked as expected, and I understood what I was requested to do. What I'm having trouble with, is the books request to try the same installation verification "(under Windows)". You instructed me to use the command prompt; isn't that different than (under Windows)?
Doing something in a Command Prompt window still counts as "under Windows". It means do this if you have Windows installed as opposed to Linux or Solaris or Mac OS. Under the "under Windows" heading there are "Console" programs and there are "GUI" programs. And with Console programs, you can either double-click on them in "MyComputer" or wherever and have the associated window disappear immediately on termination, or you can run them from a Command Prompt window so that you see the output after the program exits.
As for having you verify the java installation twice, I can see a few possiblities:
The first time (where it's just "java -version") makes sure that java is on your PATH, while the second one makes sure that JAVA_HOME is set correctly.
There are different paths you can take through the book (e.g. "If you're not interested in applets, skip chapters 2-4.") and you might have skipped the first one.
He forgot the first one was there.
Ryan [ May 10, 2005: Message edited by: Ryan McGuire ]
and see if the value of JAVA_HOME is what you expect it to be (It should be a directory like "C:\j2sdk1.4.2_06" or "C:\Program Files\Java\jdk1.5.0_02" or some such. If not, go back and re-read the section to see that you've set it correctly.