Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting PATH variables in XP

 
Cindy Burkhardt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've purchased a new computer since last using Java (Windows XP), and know I need to set the path to be able to get it to compile from the command line. I've installed J2EE, and I've installed TextPad.

I noticed that through the installation process, the following PATH user variable was created: C:\Sun\AppServer\bin

I added the following to the PATH variable: C:\j2sdk1.4.2_04\bin; and created a new CLASSPATH variable that is just "." (a single dot). This was per the instructions on the following link: http://www.cs.ucsb.edu/~teliot/Path_and_Classpath.htm

I restarted the computer and typed java and javac respectively in a command line window. java was recognized, but javac was not.

I also opened TextPad and copy and pasted Hello.java code in, saved it as such, and tried to compile it from within TextPad. It says "The system cannot find the file specified".

So obviously things are not working. Could somebody please help?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This HOWTO is very bad!
They suggest putting your source-code to the jdk/bin - directory, and the classes too!
 
Gjorgi Var
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Setting PATH variable in XP:
Start>Control Panel>System properties (arrange in the "old view mode" if necessary to find System properties)>Advanced>Enviroment Variables>User Variable for user(your name) click "new", in "variable name" type PATH, in "variable value" type c:\j2sdk1.4.2_03.bin. Click "Apply" and restart if asked... after that javac and java will work from anywhere.
Give some feedback and good luck,
 
fred rosenberger
lowercase baba
Bartender
Posts: 12146
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, i've found that if you have a command window open before you add/change any environment variable, it won't pick up the new one. only command windows opened AFTER the change is saved will know about them.
if you restart, obviously that's not a problem.
[ April 02, 2004: Message edited by: fred rosenberger ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic