my dog learned polymorphism*
The moose likes Beginning Java and the fly likes How do I see my classpath? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do I see my classpath?" Watch "How do I see my classpath?" New topic
Author

How do I see my classpath?

Paul Keohan
Ranch Hand

Joined: Mar 15, 2000
Posts: 411
I am running Windows 98 but I don't see the environment option under my system icon in the Control Panel, to lookup the classpath. How do I look up the existing classpath from DOS? I've researched this on the web but I only get information on how to set it - just not how to see it.
Thanks for any help.
Paul
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Compile and run this code. Look for java.class.path about in the middle of all of the other properties. Of course if you are REAL clever you can call just the one property using getProperty("java.classs.path");, but this works.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Or, straight from DOS, at the command line, type:
echo %classpath%
or just type:
set
to see all the environment variables.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Yeah, but my way uses java, and therefore is much more by definition.
OK, OK, so maybe your way is more efficient . . . but this IS a java forum .
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
You're absolutely correct, Cindy, yours is much more cool.
But the question was:

How do I look up the existing classpath from DOS?

So I'm more accurate
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
But
>java GetProperties
is FROM the DOS prompt!! yourself
[This message has been edited by Cindy Glass (edited May 09, 2001).]
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Allright, I give up, you win.
Never argue with a bartender
Paul Keohan
Ranch Hand

Joined: Mar 15, 2000
Posts: 411
I value both of your responses greatly but I have to say, Michael's answer was what I was actually looking for. But to be diplomatic, I now know about this little Java feature that Cindy mentioned and I'm a better Java lad overall.
Paul
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Thank you for your diplomacy Paul.
Now my shredded image is pasted back together .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How do I see my classpath?
 
Similar Threads
setting classpath
How do I set the classpath for J2EE apis?
mysql and javawebserver
ConnectionPool not found
please help !!! JDK problem