Does java --classpath override CLASSPATH or append to it? -
this question has answer here:
- java -classpath option 4 answers
if have
classpath=/blah;/foo
then run
java -cp bar.jar com.yourcompany.somemain
is classpath now
bar.jar
or it
/blah;/foo;bar.jar
basically command line switch override or augment existing classpath
?
looks -cp option overrides classpath environment variable.
$ export classpath=tests $ java printf team name no. of wins no. of losses bobcats 0 0 tigers 1 1 lions 2 2 cheetahs 3 3 jackals 4 4 leopards 5 5 snow leopards 6 6 cougars 7 7 mountain lions 8 8 bobcats 9 9 $ java -cp . printf error: not find or load main class printf
the classpath environment variable still set folder tests, however, when use -cp
option overrides it, , changes classpath .
, current directory, class file can no longer found.
Comments
Post a Comment