CLASSPATH clobbering, win2k  
Author Message
thufir





PostPosted: 2004-12-29 5:27:00 Top

java-programmer, CLASSPATH clobbering, win2k from <http://java.sun.com/j2se/1.4/install-windows.html#Environment>:

"Choose Start, Settings, Control Panel, and double-click System. On
Microsoft Windows NT, select the Environment tab; on Microsoft Windows
2000 select the Advanced tab and then Environment Variables. Look for
"Path" in the User Variables and System Variables. If you're not sure
where to add the path, add it to the right end of the "Path" in the
User Variables."

under System Variables the value of "Path" is:
"C:\Program Files\Java\jdk1.5.0\bin\"


from
<http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#2c>
I followed these instructions:

"If you still have problems, you might have to change your CLASSPATH
variable. To see if this is necessary, try "clobbering" the classpath
with the following command:

set CLASSPATH="

"clobbering" fixed the problem, "java HelloWorldApp" worked fine.
However, since I need to clobber the CLASSPATH variable I need to
change it's value, but to what, pls?


thanks,

Thufir

 
jeffc





PostPosted: 2004-12-29 5:31:00 Top

java-programmer >> CLASSPATH clobbering, win2k
"thufir" <email***@***.com> wrote in message
news:email***@***.com...
> from
> <http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html#2c>
> I followed these instructions:
>
> "If you still have problems, you might have to change your CLASSPATH
> variable. To see if this is necessary, try "clobbering" the classpath
> with the following command:
>
> set CLASSPATH="
>
> "clobbering" fixed the problem, "java HelloWorldApp" worked fine.
> However, since I need to clobber the CLASSPATH variable I need to
> change it's value, but to what, pls?

Well, if you want to leave it like that for future use, you would simply not set
it. In the same place where you found "Path", you should find "ClassPath" (case
is not important). Just delete it with the Delete button.


 
thufir





PostPosted: 2004-12-29 6:18:00 Top

java-programmer >> CLASSPATH clobbering, win2k thanks :)

 
 
thufir





PostPosted: 2004-12-30 6:42:00 Top

java-programmer >> CLASSPATH clobbering, win2k I'm getting the same error again:

C:\java\HelloWorldApp\src>set CLASSPATH=

C:\java\HelloWorldApp\src>javac HelloWorldApp.java
'javac' is not recognized as an internal or external command,
operable program or batch file.

from start/settings/control panel/system/advanced/environmental
variables/system variables

ANT_HOME
C:\ant

JAVA_HOME
C:\ProgramFiles\Java\jdk1.5.0

PATH
PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin





I don't see a CLASSPATH variable, if that matters?


thanks,

Thufir

 
 
Liz





PostPosted: 2004-12-30 6:59:00 Top

java-programmer >> CLASSPATH clobbering, win2k On 29 Dec 2004 14:41:50 -0800, thufir wrote:


>C:\java\HelloWorldApp\src>javac HelloWorldApp.java
>'javac' is not recognized as an internal or external command,
>operable program or batch file.
>

>PATH
>PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
>

What is JAVA_HOME? Is that the actuan name of your java folder? Mine
is c:\j2sdk1.4.2_05, so what I put in the path is
c:\j2sdk1.4.2_05\bin
along with other essential folders, separated by semicolons as you
show above.
It seems to me that might be one place where things could fall apart.

Oh, and I think there should be another % sign in front of PATH% (to
preserve the pre-existing path when you add the java additions to it).
hth

--
Liz
 
 
thufir





PostPosted: 2004-12-30 7:25:00 Top

java-programmer >> CLASSPATH clobbering, win2k ANT_HOME
C:\ant

JAVA_HOME
C:\Program Files\Java\jdk1.5.0

PATH
%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
is the correct info, sorry 'bout the typos :)

-Thufir

 
 
ge0rge





PostPosted: 2004-12-30 7:33:00 Top

java-programmer >> CLASSPATH clobbering, win2k "thufir" <email***@***.com> wrote
...
> C:\java\HelloWorldApp\src>javac HelloWorldApp.java
> 'javac' is not recognized as an internal or external command,
> operable program or batch file.
...
> JAVA_HOME
> C:\ProgramFiles\Java\jdk1.5.0
>
> PATH
> PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin

Looks like a % is missing before the PATH%

To check that your PATH variable is correctly set up, open a command prompt
window and type -
echo %PATH%
and if you don't see C:\ProgramFiles\Java\jdk1.5.0\bin somewhere in there,
your path is still not set correctly.

--
There is very little future in being right when your boss is wrong.


 
 
ge0rge





PostPosted: 2004-12-30 7:48:00 Top

java-programmer >> CLASSPATH clobbering, win2k "thufir" <email***@***.com> wrote
...
> JAVA_HOME
> C:\Program Files\Java\jdk1.5.0
>
> PATH
> %PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
> is the correct info, sorry 'bout the typos :)

In that case, check that you have not made another typo by navigate to
C:\Program Files\Java\jdk1.5.0\bin (to make sure that the directory actually
exists)

Better still, to avoid the hassle (of figuring whether %JAVA_HOME% is
defined at the time substitution takes place), explicitl;y set your PATH to
where you know where your java compiler is eg.
%PATH%;C:\Program Files\Java\jdk1.5.0\bin; etc...

... and the run the echo command (in my previous mail) to make sure
everything is as expected.

--
Every man thinks God is on his side. The rich and powerful know that he is.
-- Jean Anouilh, "The Lark"


 
 
thufir





PostPosted: 2004-12-30 8:23:00 Top

java-programmer >> CLASSPATH clobbering, win2k ANT_HOME
C:\ant

JAVA_HOME
C:\Program Files\Java\jdk1.5.0

PATH
%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
is the correct info, sorry 'bout the typos :)

-Thufir

 
 
jeffc





PostPosted: 2004-12-30 12:18:00 Top

java-programmer >> CLASSPATH clobbering, win2k
"ge0rge" <email***@***.com> wrote in message
news:email***@***.com...
>
> To check that your PATH variable is correctly set up, open a command
prompt
> window and type -
> echo %PATH%

Or much easier to remember, simply
set path


 
 
thufir





PostPosted: 2004-12-30 13:28:00 Top

java-programmer >> CLASSPATH clobbering, win2k ge0rge wrote:
[..]
> Better still, to avoid the hassle (of figuring whether %JAVA_HOME% is
> defined at the time substitution takes place), explicitl;y set your
PATH to
> where you know where your java compiler is eg.
> %PATH%;C:\Program Files\Java\jdk1.5.0\bin; etc...
[..]

old value for PATH:
%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin

current value for PATH:
%PATH%;C:\Program Files\Java\jdk1.5.0\bin;%ANT_HOME%\bin

C:\Program Files\Java\jdk1.5.0\bin is indeed the location for the jdk.

somewhat negates the point of having JAVA_HOME and ANT_HOME by
explicitly setting the PATH, but there you are.
ok, javac works again, thanks :)

-Thufir

 
 
ge0rge





PostPosted: 2004-12-30 16:05:00 Top

java-programmer >> CLASSPATH clobbering, win2k "thufir" <email***@***.com> wrote
...
> somewhat negates the point of having JAVA_HOME and ANT_HOME by
> explicitly setting the PATH, but there you are.
> ok, javac works again, thanks :)

PATH=%JAVA_HOME%
JAVA_HOME=xyz
might not set the PATH correctly but reversing the order of these statements
probably will. It depends on the order the OS is reading the variables and
doing the substitution.

In any case, leave your JAVA_HOME set as it may be used by other software
eg. ant or j2ee

--
If you sow your wild oats, hope for a crop failure.


 
 
thufir





PostPosted: 2004-12-31 19:33:00 Top

java-programmer >> CLASSPATH clobbering, win2k heh, that's fundamental and yet...silly! the way the GUI presents the
var's implies, to me, that the order wouldn't matter, and yet, it does.

javac's broken again, but jEdit compiles stuff fine, so...the saga
continues for largely unknown (to me) reasons.