It is in my Java book, and it is something that I need to do in order to proceed with working in Java, so how would this not be a Java-related question? I thought that one of the rules on this ranch is to be nice. Do I really warrant a smackdown on this? My OS is Windows XP.
Henry's point was that a simple google search might have gotten you the answer faster. And setting environment variables is more of a "general computing" issue, not Java specific.
In any case, rt-click "my computer". Go to the "Advanced" tab. Click "Environment Variables". You probably want to edit the existing PATH in your System variables. Scroll down to find it, highlight, and click "edit".
Add whatever you need to, making sure to follow the correct format (each new directory should be separated by a semicolon). Don't delete stuff out of here as that may break other programs.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Jul 28, 2010
Ok, Fred, I am in that window/directory - in the actual field - but am unsure what to do next - so I appreciate that you specify do not delete. I'd like to ask for further clarification on the exact syntax (the instructions that I found on the Sun site do not give specifics other then where to go and the field to change), but am now hesitant to do so, as I may be informed that my question does not belong here.
This is my first visit to this site, and I thought that as I learn Java and develop my skills, I would continue to participate in these forums...I'm not so sure of that now...
I am using the Head First Java Series, the first book I am using being "Head First Java", and that book advises referring to JavaRanch for questions on setting this up.
I'll admit that I was a bit blunt.... but I was seriously trying to be helpful. I even double checked with google to make sure that my recommendation of "setting Path environment" and "windows xp" would be helpful -- and confirmed that most of the first page links were relevant.
Joined: Jul 28, 2010
I wasn't berating anyone. I just need to know how to do this. I didn't know that I'd have to be strung up for asking a question. I did find the instructions on the Sun site, but they are not detailed enough. I have never changed this variable before, I don't know the correct syntax or what to do with it, and I was just asking if someone knows and would be kind enough to tell me. I'm sorry I asked. Obviously my question is too stupid for this site.
you can see it's pretty long. what I'd probably do is click in there somewhere, then hit the 'end' key. that should put your cursor at the end of everything else. then you need to add the path to your install of the Java environment. Nobody here can tell you what that is - it depends on where you told it to put it when you ran the install.
If you dig through mine, you can see my "C:\Program Files\Java\jdk1.6.0_20\bin". This is where the program javac.exe physically exists on the machine. You need to add whatever directory your javac.exe is so that you can compile stuff, and whatever directory your java.exe lives in (they may be the same place) to run java programs.
so, once your at the end of the line, simply type a semi-colon, and add the next directory. If you need a second dir, add another semi-colon and add the second directory after that.
Then click through all the 'saves' and 'apply's until you get out of that.
you will then need to open a new command window, as any already existing ones will NOT pick up the changes.