Windows/classpath question

R

Rhino

I have a question about classpath in Windows XP Professional.

When I check my environment variables, I have both 'user' (Rhino) and
'system' environment variables. I have a classpath environment variables in
both categories, 'user' and 'system', and they have markedly different
values.

When I am logged on as Rhino, is Windows using the 'user' version of the
classpath variable, the 'system' version, or a concatentation of both?

Despite using Windows for a few years now, I'm afraid I've never looked into
the matter of the multiple classpaths before since I always seemed to get
everything working fine by simply ignoring the 'user' environment variables
and sticking to the 'system' ones. However, I'm now having a problem with
NoClassDefFoundError.

I am trying to do the sqlj command to translate sqlj source to java source
but I keep getting the NoClassDefFoundError, even though the class I need is
present in sqlj.zip and sqlj.zip is in the system classpath.

I'm wondering if, somehow, Java is only seeing the 'user' classpath which
doesn't contain sqlj.zip. That doesn't seem likely to me but I can't think
of anything else after several hours of messing with this.

If someone could clarify the purpose of the 'user' and 'system' categories
of environment variables, I would be very grateful.

Also, while I've got you, when do changes to environment variables take
effect in XP? As soon as I click 'save'? When I close the Control Panel? Or
do I need to reboot to be sure that they have taken effect?
 
L

Lisa

Rhino said:
I have a question about classpath in Windows XP Professional.

When I check my environment variables, I have both 'user' (Rhino) and
'system' environment variables. I have a classpath environment variables in
both categories, 'user' and 'system', and they have markedly different
values.

When I am logged on as Rhino, is Windows using the 'user' version of the
classpath variable, the 'system' version, or a concatentation of both?

I only have an entry under 'user' for 'classpath', but I have both 'user'
and 'system' entries for 'path'. I see that it is a concatination of both,
system first. I suspect the same for 'classpath' but you can easily check by
opening a command window and typing "set" which spits out all of your env
variables.
 
H

Hikikomori

I googled it out for a bit and it seems like User environment variables
take precedence over System environment variables. If classpath is
defined in both your system and user environment, the classpath set in
the user environment will take precedence over the system one. Change
the classpath variable for user and see if things work out.
 
R

Rhino

Hikikomori said:

Thank you both for replying. Hikikomori, you are right: 'user' classpath
takes precedence over 'system' classpath. There is no concatenation of the
two classpaths. That made it very simple to solve my problem: I added the
contents of my 'user' classpath to my 'system' classpath and deleted the
'user' classpath. Now my commands work!

Thank you, this was driving me crazy!!

Rhino
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top