• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classpath Question

 
Rob Levo
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I you have the CLASSPATH environment variable set, and also use the -classpath option in the java command, does the -classpath option override the environment varibable paths, or are they both used.
Thanks for the help.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know. You could try different settings and see which one works. Let us know what you learn.
 
Rob Levo
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried, seems like a no-brainer to test, but my results have been inconsistent.
Sometimes it looks like it also uses to env variable and sometimes it doesn't.
That is why I wanted to know how it was supposed to work.
Thanks, sorry if it appeared as if I did not even give it a try.
Anyone know the rule?
 
Barry Andrews
Ranch Hand
Posts: 523
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From my experience (Windows), java -classpath will override the the system classpath always.

Barry
 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The command line option -classpath should always override the environment variables.
 
Rob Levo
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic