> To set the classpath, just add it to the existing CLASSPATH variable.
> I'd use the CLASSPATH because -cp over-rides your existing classpath.
> The -cp switch works for simple self-contained programs but may not work
> if there are extra .jar's or other .class files that are needed
> elsewhere on the disk. It's easiest to set CLASSPATH from the Control
> Panel, imo. Just add ;c:\my\stuff to the end of the CLASSPATH variable
> and you should be ok.
>> To set the classpath, just add it to the existing CLASSPATH variable.
>
>> (For Cygwin, I guess you'd use your example and set CLASSPATH=/c/java)
>
> Why in the world would you assume that? That is very dangerous.
I'm not sure of your point. The OP gave an example of using /c/java/a
as a classpath. I assumed the extra /a was his issue.
> You do realize that using Cygwin, or Windows without Cygwin, one can
> install the JDK anywhere they please, and need not install only one JDK,
> don't you? For that matter, what makes you think the OP is even using
> Windows?
Well for the last question Cygwin is expressly for users on Windows. If
he's running *nix or Solaris or a Mac, why would he need Cygwin? ;-)
For me, it's more convenient to set the system CLASSPATH once, and not
mess with it again. If you are running more complicated set-ups which
require different .jars for different versions of JDK and project, I can
see that this would be rather inconvenient and setting the class search
path for each project might be better.
Lew - 27 Sep 2007 20:27 GMT
>>> To set the classpath, just add it to the existing CLASSPATH variable.
>>
>>> (For Cygwin, I guess you'd use your example and set CLASSPATH=/c/java)
> I'm not sure of your point. The OP gave an example of using /c/java/a
> as a classpath. I assumed the extra /a was his issue.
Cygwin drives have the format /cygdrive/c/, not merely /c/. /c/ would map to
%CYGWIN_INSTALL_DIR%/c/, not C:/.
Cygwin also allows the notation c\:/.
Lew wrote:
>> For that matter, what makes you think the OP is even using Windows?
> If he's running *nix or Solaris or a Mac, why would he need Cygwin? ;-)
You are right. I missed the part of the original message that said:
> Can you guide me on cygwin [sic] part?
That's not the only mistake I made in my post, but I have enough ego not to
point out any more.
> For me, it's more convenient to set the system CLASSPATH once, and not mess with it again. If you are running more complicated set-ups which require different .jars for different versions of JDK and project, I can see that this would be rather inconvenient and setting the class search path for each project might be better.
I usually work on multiple projects, not all of which use the exact same
libraries. A global CLASSPATH is useless to me.
I see how it would work for other scenarios, though.
My only issue there is that CLASSPATH is extrinsic to the compilation command
and therefore harder by a skootch to track. The -cp option is right there in
the compilation command (or Ant script) where you can't miss it.
A similar argument pertains to putting libs in the shared/ (or equivalent)
library of an application server vs. in the application-specific lib/ folder.

Signature
Lew
David Zimmerman - 28 Sep 2007 16:07 GMT
>>>> To set the classpath, just add it to the existing CLASSPATH variable.
>>>
[quoted text clipped - 7 lines]
>
> Cygwin also allows the notation c\:/.
mkdir /c
mount c: /c
Tten you can refer to it as /c/... Makes life much easier
Lew - 29 Sep 2007 04:10 GMT
> mkdir /c
> mount c: /c
I see. Nice - I've never thought of that and I've been using Cygwin for years.
I can only hope to remove my foot from my mouth by changing my opinion rapidly
once I understand the facts.

Signature
Lew