• 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

JAVA_HOME

 
Ranch Hand
Posts: 664
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the following represent a problem? Do I need to update the %JAVA_HOME% environment variable?


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Jon>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_17\bin //this sub-directory does not exist on my file system...

C:\Documents and Settings\Jon>java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)

C:\Documents and Settings\Jon>
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java itself does not use the JAVA_HOME environment variable. But some other programs do use JAVA_HOME to find the Java runtime environment or JDK. Why don't you just update the variable to point to the directory where your JDK is installed?
 
Jon Camilleri
Ranch Hand
Posts: 664
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesper de Jong wrote:Java itself does not use the JAVA_HOME environment variable. But some other programs do use JAVA_HOME to find the Java runtime environment or JDK. Why don't you just update the variable to point to the directory where your JDK is installed?



That's what I did.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Jon>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_25\bin

C:\Documents and Settings\Jon>java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)

C:\Documents and Settings\Jon>
 
Saloon Keeper
Posts: 15491
363
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way, JAVA_HOME needs to point to the installation path, not the bin directory.

Why do want to set this variable anyway? Unless you're setting up something like Ant, setting just the PATH variable is enough.
 
Ranch Hand
Posts: 37
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do a "javac" in command prompt, you'll know whether you've set the path correct
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mayu Mayooresan wrote:do a "javac" in command prompt, you'll know whether you've set the path correct


Yes, but that has nothing to do with the JAVA_HOME environment variable - as already noted above, Java itself doesn't use the JAVA_HOME environment variable. Some other tools, such as Apache Ant that Stephan mentioned, do use JAVA_HOME to locate the JRE or JDK.
 
reply
    Bookmark Topic Watch Topic
  • New Topic