What does "java -classpath .:" mean?

The documentation is not mentioned , but I get a ClassNotFoundException when called without :.

Full line:

java -classpath .:soy-20100708.jar HelloWorld

This works too ...

java -classpath :soy-20100708.jar HelloWorld
+3
source share
3 answers

: used to separate class path entries.

Therefore, .:soy-20100708.jarmeans "search in the current directory and inside soy-20100708.jar."

The second option ": soy-20100708.jar" has no special meaning (it is distorted). This may be interpreted in some way, but I do not know any special meaning.

Can you post the contents of the file jar? What files does it contain and in which directories?

+5
source

"." , , ":" - . -, :

CLASSPATH . . ; :. ., , CLASSPATH.

+1

":" unix, ";" . :

java -classpath a.jar:b.jar OR java -classpath a.jar;b.jar

. "." . , - *.class, .

, ":", ( ), , , ( dir classpath aswel)

EDIT: , dir/* JAVA 6

+1
source

All Articles