title: JAVA Newbie Alert: Trying to run Java class and getting ClassNotFoundException
body: <p>Java newbie. I am trying to run a java main class from cmd line and getting back <code>ClassNotFoundException</code>:</p>
  
  <pre><code>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/"
  </code></pre>
  
  <p>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.</p>
  
  <p>Any help appreciated!</p>
  
  <p><strong>EDIT#1</strong>: as some of you may have guessed classname is <code>demo.rmi.librarymanager.server.LibraryManagerServer</code></p>
  
  <p><strong>EDIT#2</strong>: OK - thanks to people suggestions I think I got the syntax right this time but I am still getting <code>ClassNotFoundException</code> but on a different class in the common package:</p>
  
  <pre><code>demo.rmi.librarymanager.common.Library
  </code></pre>
  
  <p>Here's the new cmd line:</p>
  
  <pre><code>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"
  </code></pre>
  
  <p>Shall I add the <code>c:/development/eclipse/workspace/Library-Manager-Common/bin</code> path (where <code>demo.rmi.librarymanager.common.Library</code> lives) together with <code>c:/development/eclipse/workspace/Library-Manager-Server/bin</code> after -cp as a command line argument?</p>
  
  <p>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 <a href="http://www.genady.net/rmi/index.html" rel="nofollow noreferrer">RMI plugin</a> 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!).</p>
  
  <p><strong>EDIT#3</strong>: Ok I got it working:</p>
  
  <pre><code>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"
  </code></pre>
  
  <p>Thanks to everyone for the shower of humbleness.</p>