Does java --classpath override CLASSPATH or append to it? -


this question has answer here:

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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -