• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JAVA_HOME

 
Ranch Hand
Posts: 664
Eclipse IDE Chrome
  • 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>
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • 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
Eclipse IDE Chrome
  • 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>
 
Saloon Keeper
Posts: 12147
258
  • 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.
 
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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • 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.
 
Your mind is under my control .... your will is now mine .... read this tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic