wood burning stoves*
The moose likes Beginning Java and the fly likes How do I Change the Path Variable and Get the Command Prompt to Coordinate Afterwards Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do I Change the Path Variable and Get the Command Prompt to Coordinate Afterwards" Watch "How do I Change the Path Variable and Get the Command Prompt to Coordinate Afterwards" New topic
Author

How do I Change the Path Variable and Get the Command Prompt to Coordinate Afterwards

Benjamin Chau
Ranch Hand

Joined: Oct 05, 2008
Posts: 49
When I change the environmental variable to create a new user name and variable, thus creating a new path variable that points to my Java compiler, I still can't get the Command Prompt to change to the new path variable.

I'm running XP Media Center version and everything seems to be installed correctly as far as Java (j2se 1.5.0 version 6) goes. Any help would be greatly appreciated. Thanks!
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there and welcome to Javaranch!

How are you changing the PATH? If you are doing it outside of the command prompt (e.g. In My Computer --> Advanced --> Environment Variables) then you need to open up a new command prompt for that to take effect.

Hope that helps!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36566
    
  16
There is more about the PATH in the "common problems" page. You don't have to set the CLASSPATH. If you follow the links it says permanent setting is "optional." Forget about "optional" and set it anyway.
Benjamin Chau
Ranch Hand

Joined: Oct 05, 2008
Posts: 49
Originally posted by Martijn Verburg:
Hi there and welcome to Javaranch!

How are you changing the PATH? If you are doing it outside of the command prompt (e.g. In My Computer --> Advanced --> Environment Variables) then you need to open up a new command prompt for that to take effect.

Hope that helps!


Hi Martijn! Thanks for the welcome. This is a pretty neat online community for Java people. I still can't get it to work even though I tried your suggestion of closing the Command Prompt and reopening it.

Maybe there's a way to change the path variable also when I open up my Java software (NetBeans IDE 5.0)...
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36566
    
  16
Yes, you can set the PATH temporarily for the lifetime of that window. On Linux you write something like

export PATH = /usr/java/jdk1.6.0_07/bin/:$PATH

and on Windows you have to do a search and you find this post where somebody tells how to do it.
Benjamin Chau
Ranch Hand

Joined: Oct 05, 2008
Posts: 49
Originally posted by Campbell Ritchie:
Yes, you can set the PATH temporarily for the lifetime of that window. On Linux you write something like

export PATH = /usr/java/jdk1.6.0_07/bin/:$PATH

and on Windows you have to do a search and you find this post where somebody tells how to do it.


Hi Campbell. Thanks for your great help! I still didn't get it to work despite everything I tried from reading the posts. Here's the command I issued with the relevant path location of where I installed Java on my computer.

set PATH=C:\Documents and Settings\Benjamin Q. Chau\Desktop\j2sdk-1_4_2_13-nb-5_0-win-ml\bin;%PATH%

Oh well, hoping for a breakthrough soon...
Benjamin Chau
Ranch Hand

Joined: Oct 05, 2008
Posts: 49
Originally posted by Campbell Ritchie:
Yes, you can set the PATH temporarily for the lifetime of that window. On Linux you write something like

export PATH = /usr/java/jdk1.6.0_07/bin/:$PATH

and on Windows you have to do a search and you find this post where somebody tells how to do it.


No wait a minute, shouldn't I set the path variable to point to where I have NetBeans IDE 5.0 installed, since that's the Java environment where my code is executing???
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36566
    
  16
No, you set the PATH to include wherever you installed Java.

And if you are a raw beginner, you are probably better off using a text editor (not Notepad, try googling for Notepad++ and Notepad2 which are better for programming), instead of an IDE like NetBeans.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I Change the Path Variable and Get the Command Prompt to Coordinate Afterwards
 
Similar Threads
Running code
Eclipse IDE and JDK
Installation Problem
'javac' is not recognized as ...
var-args doubt...