For Programmers: Free Programming Magazines  


Home > Archive > Java Help > December 2004 > CLASSPATH clobbering, win2k









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author CLASSPATH clobbering, win2k
thufir

2004-12-28, 8:58 pm

from <http://java.sun.com/j2se/1.4/instal...tml#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/tuto...a/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

2004-12-28, 8:58 pm


"thufir" <thufir.hawat@mail.com> wrote in message
news:1104269210.989282.230370@z14g2000cwz.googlegroups.com...
> from
> <http://java.sun.com/docs/books/tuto...a/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

2004-12-28, 8:58 pm

thanks :)

thufir

2004-12-29, 8:58 pm

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

2004-12-29, 8:58 pm

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

2004-12-29, 8:58 pm

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

2004-12-29, 8:58 pm

"thufir" <thufir.hawat@mail.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

2004-12-29, 8:58 pm

"thufir" <thufir.hawat@mail.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

2004-12-29, 8:58 pm

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

2004-12-30, 3:58 am


"ge0rge" <ge0rge@privacy.net> wrote in message
news:33gt86F3v2pmdU1@individual.net...
>
> 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

2004-12-30, 3:58 am

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

2004-12-30, 8:58 am

"thufir" <thufir.hawat@mail.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

2004-12-31, 8:56 am

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.


--
Thufir Hawat

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com