0

java -Djava.library.path=/usr/local/lib -classpath /usr/local/share/java/zmq.jar:. hwclient

In the above example why is there ":." after the classpath?

2
  • colon is the delimiter of classpath entries, and . is the current directory Commented Apr 13, 2012 at 15:07
  • @Alex docs.oracle.com/javase/tutorial/rmi/running.html uses ; as a delimiter for Windows... (I found this question because I couldn't figure out how to delimit on Unix and didn't read the above link very well). Commented Oct 10, 2012 at 16:44

2 Answers 2

2

http://docs.oracle.com/javase/1.3/docs/tooldocs/win32/classpath.html

"The default class path is the current directory. Setting the CLASSPATH variable or using the -classpath command-line option overrides that default, so if you want to include the current directory in the search path, you must include "." in the new settings."

Sign up to request clarification or add additional context in comments.

1 Comment

The link does not work - Oracle probably moved it. Try this one: Setting the class path
1

: The colon is the classpath separator.

. The fullstop is a reference to the current directory

-classpath /usr/local/share/java/zmq.jar:.

Because the classpath overrides the default reference to the current directory the above line adds both /usr/local/share/java/zmq.jar and the current directory to the classpath. Without :. there would be no reference to the current directory and the JVM wouldnt find the hwclient class.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.