• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

checking java installation

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Bill Hege
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)?
 
Ryan McGuire
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
     
    Bill Hege
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I tried what you suggested and the response was: the system cannot find the path specified. Now what?
     
    Bartender
    Posts: 1844
    Eclipse IDE Ruby Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Now try typing:

    SET JAVA_HOME

    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.
     
    Bill Hege
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    the response from set JAVA_HOME was as expected.

    Thanks for your help, I can move on to next subject now.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic