File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes confusion over setup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "confusion over setup " Watch "confusion over setup " New topic

confusion over setup

SD Leech

Joined: May 13, 2003
Posts: 16
Im confused over the environment variables. Most sun tutorials say how to set environment variables e.g set JAVA_HOME=c:\j2sdk1.4.0. Sometimes I see
JAVA_HOME=c:\j2sdk1.4.0\jre\bin or JAVA_HOME=c:\j2sdk1.4.0\bin. In the system properties environment variables window there are user variables and system variables. Whats the difference and where should I be setting what such as JAVA_HOME or ANT_HOME since there are 2 path variables : one in system and one in user. I ask because I tried to set JAVA_HOME=c:\j2sdk1.4.0 in the cmd line and it didnt recognise it when I tried to goto JAVA_HOME
Michael Fitzmaurice
Ranch Hand

Joined: Aug 22, 2001
Posts: 168
This is a windows thing - user environmental variables only apply to the user logged on at the time they were set, so each user of a machine can have a different set of environmental variables. System ones affect everyone. Which one you use depends on what is most appropriate for the machine & organisation you are working with. If you are at home and are the only user of that machine, it probably will not make any practical difference.
Also remember that when you set environmental variables in a DOS console, they only exist for the lifetime of that console, so if you want them to be permanent you should set them through the 'System' option on the control panel. After you set a new environmental variable you will need to open a new DOS console in order to see it - existing consoles will be unchanged.
Hope this helps

"One good thing about music - when it hits, you feel no pain" <P>Bob Marley
SD Leech

Joined: May 13, 2003
Posts: 16
Thanks - I think I understand....
does this also apply when setting the classpath variables too?
just to clarify ... the 'system' path variable should have all the binaries such as j2sdk and j2sdkee right? and stuff such as java home etc which is the environment I change directory too can be in user variables?
SD Leech

Joined: May 13, 2003
Posts: 16
oh and another thing.... how do I know when to set path to c:\j2sdk1.4.0\jre\bin or c:\j2sdk1.4.0\bin ... I dont quite understand what binaries are, and dont know when I need the jre?
thanks for your help
I agree. Here's the link:
subject: confusion over setup
It's not a secret anymore!