title: Classpath set but java.lang.NoClassDefFoundError com/google/protobuf/MessageOrBuilder error?
body: <p>I am trying to run a java program that uses protobuf.jar, but I keep getting this error.</p>
  
  <p>I have set my classpath variable in linux so that:</p>
  
  <pre><code> CLASSPATH=/home/.../src/PlaceServer.class:/home/.../src/protobuf.jar:/home/.../src
   export CLASSPATH
  </code></pre>
  
  <p>But then when I run my program in the command line after reading in the jar.</p>
  
  <pre><code> java PServer 
  </code></pre>
  
  <p>I get this:</p>
  
  <pre><code> java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder
  </code></pre>
  
  <p>However when I run another program that also reads the same jar, this one called BServer</p>
  
  <pre><code> java BServer
  </code></pre>
  
  <p>It works fine, and correctly as I want it. I even tried running under these commands instead</p>
  
  <pre><code> java -cp .protobuf.jar PServer
  </code></pre>
  
  <p>And it still did not work for PServer.</p>
  
  <p>However, if I run the same programs on my Macbook from the command line (also in Eclipse in either OS) I do not get this Exception and it all works fine. </p>
  
  <p>Thanks for your help!</p>