• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAVA_HOME  RSS feed

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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>
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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>
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
Mayu Mayooresan
Ranch Hand
Posts: 37
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!