[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Setting JAVA_HOME Environment Variable in Windows XP

Posted on 2009-02-20
17
Medium Priority
?
12,168 Views
Last Modified: 2012-05-06
Hi,

I am having trouble setting the JAVA_HOME Environment Variable in Windows XP.

I set it to JAVA_HOME under System Variables and the path to C:\Program Files\Java\jre6

Yet it doesn't seem to be detected.

Any help would be greatly appreciated.

Best,

Justin
0
Comment
Question by:jsuissa
  • 6
  • 5
  • 4
  • +1
17 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 1400 total points
ID: 23691494
>> and the path to C:\Program Files\Java\jre6


JAVA_HOME should be

"C:\Program Files\Java\jre6"

and PATH

%JAVA_HOME%\bin;<rest of existing path here>
0
 
LVL 15

Expert Comment

by:fsze88
ID: 23691677

C:\Documents and Settings\fsze88>echo %java_home%
%java_home%
 
C:\Documents and Settings\fsze88>set java_home=C:\Program Files\Java\jre6;
 
C:\Documents and Settings\fsze88>echo %java_home%
C:\Program Files\Java\jre6;
 
C:\Documents and Settings\fsze88>

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 23691781
Of course, the above will set the variable for that console session only. To do it permanently, you need to use environment variables
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:fsze88
ID: 23692168
set Environment Variables
Environment-Variables.JPG
0
 

Author Comment

by:jsuissa
ID: 23692273
Hi,

The above screenshot is exactly what I have and I rebooted too.

Should it be:

Variable name: C:\Program Files\Java\jre6
Variable value: %JAVA_HOME%\bin;C:\Program Files\Java\jre6

Thanks!

Best,

Justin
0
 
LVL 15

Expert Comment

by:fsze88
ID: 23692358
?? are you setting Variable name : JAVA_HOME
add a new one
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jre6
if you need set PATH also
just append *;C:\Program Files\Java\jre6* at tail of value of Variable name *PATH*
is it your question?
0
 

Author Comment

by:jsuissa
ID: 23692411
Yes I am settig the Variable name  to JAVA_HOME just like that
0
 
LVL 15

Expert Comment

by:fsze88
ID: 23692650
did you set on System Environment Variables / User Environment Variables?
it works on my computer after rebooted.... case is not sensitive
or will it be set/declare twice at System Environment variables?
C:\Documents and Settings\fsze88>echo %JAVA_HOME%
C:\Program Files\Java\jre6
 
C:\Documents and Settings\fsze88>echo %java_home%
C:\Program Files\Java\jre6
 
C:\Documents and Settings\fsze88>

Open in new window

0
 

Author Comment

by:jsuissa
ID: 23692707
Hi,
I only set the "System Variables" not the "User Variables", what should those be ?

Thanks for your help!

Justin
0
 
LVL 15

Assisted Solution

by:fsze88
fsze88 earned 600 total points
ID: 23692838
will it because of you set user environment variables with the same name JAVA_HOME ?
If you set user environment variables named JAVA_HOME, it will read the value of JAVA_HOME from user variable rather than system environment variable.... will it be your source of your problem?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 23692841
>>Variable name: C:\Program Files\Java\jre6

That should be the *value* of JAVA_HOME, not a name
0
 
LVL 92

Expert Comment

by:objects
ID: 23697751
what exactly is the problem you are having?

0
 

Author Comment

by:jsuissa
ID: 23698634
No matter what I do when  try setting it as a user name and variable or a system variable for  JAVA_HOME and C:\Program Files\Java\jre6 it dosen't seem to work.
0
 
LVL 92

Expert Comment

by:objects
ID: 23698636
what exactly isn't working?

0
 
LVL 15

Expert Comment

by:fsze88
ID: 23698738
Okey, could you try add a new system variable temptest value thatsok
reboot your XP, try echo %temptest% from command prompt  see how it works?
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1400 total points
ID: 23699152
Are you certain that C:\Program Files\Java\jre6 is the directory into which you installed Java? That's not the default i suspect
0
 

Author Closing Comment

by:jsuissa
ID: 31549214
Our actual problem seemed to stem from downloading the wrong JDK. We're still not sure why it now works as a User Variable. However, all experts we're very helpful in pointing us in the right direction with this issue.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month19 days, 16 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question