We must enclose them with quotes.
Java supports two approaches for setting paths of the classes.
It is used as;
When the paths to the jar files have spaces, the commandline classpath option causes errors. Under Windows installation like 2000/NT/XP, all the users get a folder with the user name under a folder named "Documents and Settings" (which has a space). And if the jar files are under the user folder, path would look like below.
"C:/Documents and Settings/someUser/.."
which would cause the above error.
2. Put quotes on individual paths
- Set the commandline option classpath
- Set the CLASSPATH environment variable
Classpath via commandline is preferred
So the first option is the preferred way due to the support for multiple classpaths.It is used as;
java -classpath first.jar;second.jar TestClient
When the paths to the jar files have spaces, the commandline classpath option causes errors. Under Windows installation like 2000/NT/XP, all the users get a folder with the user name under a folder named "Documents and Settings" (which has a space). And if the jar files are under the user folder, path would look like below.
"C:/Documents and Settings/someUser/.."
which would cause the above error.
How to over come this issue
1. Put quotes and group the whole classpath
java -classpath
"C:/Documents and Settings/user/project/lib/axis.jar;
C:/Documents and Settings/user/project/lib/axis-ant.jar;"
TestClient
java -classpath
"C:/Documents and Settings/user/project/lib/axis.jar";
"C:/Documents and Settings/user/project/lib/axis-ant.jar;"
TestClient
COMMENTS