• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorry, but i just dont get how to set the PATH variable :sheepish:  RSS feed

 
Matt Mason
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im starring at the Environmental Variables dialog (XP) and I am confused as to what to add and where. User has no PATH or CLASSPATH. System has both but they already have a path set to them (QuickTime something). I assume that I can add a PATH variable to just the user or the whole system but Im not sure if I should overwrite the existing PATH and CLASSPATH under System or ad a duplicate or what. Some say click 'New,' others say to double-click on an existing PATH variable. And still other say to click on and existing PATH and then ADD a new Java path to it. Furthermore, im not sure what to do with this JAVA_HOME PATH others have referred to. Ugh. I feel like a dolt. Help please. If it helps, my Javac.exe is located at C:\Program Files\j2sdk1.4.2_12\bin. Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37465
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt,
Welcome to JavaRanch!

On my Windows machine, I adjust the system PATH and CLASSPATH. Even at work, others rarely use my machine. And even then, they expect Java to be there.

Some programs require JAVA_HOME to be set. If you are just getting started and running from the command line, you don't need it.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37465
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"IconoclastDX",

You seem to have changed your display name from a valid one "Matt M-something" to an invalid one "IconoclastDX". Please take a look at the JavaRanch Naming Policy and adjust your display name to match it. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks,
Jeanne
Bartender
 
Matt Mason
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about he nomenclature blunder.

So, you said to "adjust" the PATH and CLASSPATH variables. So that means I should overwrite whatever is currently set for them with 'C:\Program Files\j2sdk1.4.2_12\bin'? That seems weird to me but im no expert. IF this is correct, what do I need to insert for CLASSPATH, as the installation instructions didnt mention it.

btw, will it have a problem with the space in "Program Files"?

Thanks again!
 
Steph Stanfield
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Matt,

I'm in a similar situation, trying to get my machine set up for learning Java. I found out a couple of things:

1. If you scroll through the text already showing in the environment variable properties, you will see that there are multiple paths, separated by ";" (minus the quotes), so you can add your new path and a ; and save the changes.

2. My book says I should be able to type "% javac" (again, minus the quotes) at the command line, but when I do, I get "'%' is not recognized as an internal or external command, operable program or batch file." So I tried it without the "%", just "javac" and it worked fine.

Good luck!

Steph
 
Steph Stanfield
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
p.s. The existing entries under the PATH variable have spaces in "Program Files", so no problem there. And I didn't touch CLASSPATH and it still worked.

See ya.

Steph
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37465
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Matt Mason:
Sorry about he nomenclature blunder.

So, you said to "adjust" the PATH and CLASSPATH variables. So that means I should overwrite whatever is currently set for them with 'C:\Program Files\j2sdk1.4.2_12\bin'? That seems weird to me but im no expert. IF this is correct, what do I need to insert for CLASSPATH, as the installation instructions didnt mention it.

btw, will it have a problem with the space in "Program Files"?

Thanks again!

No problem. Thanks for putting your display name back.

By "adjust", I meant to add ";C:\Program Files\j2sdk1.4.2_12\bin" to the PATH. Don't overwrite what it is there! It will cause your other programs to stop working.

You don't need to adjust the system CLASSPATH, especially at the beginning. I misspoke there.

And no, you won't have problems with the space in Program Files.
 
Matt Mason
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help Jeanne and Steph! Ive got it working now. Although it would be nice if the CLASSPATH would search sub directories.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!