Java newbie. I am trying to run a java main class from cmd line and getting back ClassNotFoundException
:
java -cp class c:\development\eclipse\workspace\Library-Manager-Server\bin\demo\rmi\librarymanager\server\LibraryManagerServer
-Djava.security.policy="C:\Development\Eclipse\Workspace\Library-Manager-Server\security.policy"
-Djava.rmi.server.codebase="file:/C:/Development/Eclipse/Workspace/Library-Manager-Server/bin/ file:/C:/Development/Eclipse/Workspace/Library-Manager-Common/bin/"
The class is definitely there in the bin (where eclipse drops it) but for some reason (probably trivial) it cannot be found when I run the cmd line above.
Any help appreciated!
EDIT#1: as some of you may have guessed classname is demo.rmi.librarymanager.server.LibraryManagerServer
EDIT#2: OK - thanks to people suggestions I think I got the syntax right this time but I am still getting ClassNotFoundException
but on a different class in the common package:
demo.rmi.librarymanager.common.Library
Here's the new cmd line:
java -cp c:/development/eclipse/workspace/Library-Manager-Server/bin demo.rmi.librarymanager.server.LibraryManagerServer
-Djava.security.policy="C:/Development/Eclipse/Workspace/Library-Manager-Server/security.policy"
-Djava.rmi.server.codebase="file:/C:/Development/Eclipse/Workspace/Library-Manager-Server/bin file:/C:/Development/Eclipse/Workspace/Library-Manager-Common/bin"
Shall I add the c:/development/eclipse/workspace/Library-Manager-Common/bin
path (where demo.rmi.librarymanager.common.Library
lives) together with c:/development/eclipse/workspace/Library-Manager-Server/bin
after -cp as a command line argument?
Thanks to everyone for their help and patience - I am working on an RMI application and everything was good till I was working inside eclipse using the RMI plugin but now I am having a bit of an hard time as I am fairly new to java (as you cas see from my question!).
EDIT#3: Ok I got it working:
java -cp c:/development/eclipse/workspace/Library-Manager-Server/bin;c:/development/eclipse/workspace/Library-Manager-Common/bin
demo.rmi.librarymanager.server.LibraryManagerServer
-Djava.security.policy="C:/Development/Eclipse/Workspace/Library-Manager-Server/security.policy"
-Djava.rmi.server.codebase="file:/C:/Development/Eclipse/Workspace/Library-Manager-Server/bin file:/C:/Development/Eclipse/Workspace/Library-Manager-Common/bin"
Thanks to everyone for the shower of humbleness.