Reputation: 1600
I am getting "could not find or load main class" error even though i am setting the class path correctly.
Here is my directory structure:
src\org\apache\ws\axis2
Inside axis2 directory, i have my Client.class file.
Now, to run the Client class file, i gave the following command from src directory
java -cp "C:\Documents and Settings\F1QBWFA\My Documents\Downloads\temp\src\org\apache\ws\axis2" org\apache\ws\axis2\Client
I tried this as well:
java -cp "C:\Documents and Settings\F1QBWFA\My Documents\Downloads\temp\src\org\apache\ws\axis2" org.apache.ws.axis2.Client
And i get the same error. What am i doing wrong here?
Upvotes: 0
Views: 451
Reputation: 62573
As it implies, the classpath is set to a path where you can find, well, classes
I think you might be having classes stored in the bin
or the classes
directory.
Change your command line to:
java -cp "C:\Documents and Settings\F1QBWFA\My Documents\Downloads\temp\classes" org.apache.ws.axis2.Client
If you have the classes alongside src, then change it to
java -cp "C:\Documents and Settings\F1QBWFA\My Documents\Downloads\temp\src" org.apache.ws.axis2.Client
Classpaths should only be set till the root of the package.
Upvotes: 0
Reputation: 133567
Shouldn't it be
java -cp "C:\Documents and Settings\F1QBWFA\My Documents\Downloads\temp\src" org.apache.ws.axis2.Client
Class path should refer to the root of your package structure, not to the specific folder of the inner package. Of course I'm assuming you have package org.apache.ws.axis2;
at the beginning of Client.java
Upvotes: 1