Can compile but not run the code
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4098787/classic-error-noclassdeffounderror">Classic error, NoClassDefFoundError </a>  </p>
</blockquote>



<p>The previous question was a mistake which I use javac not java, I was able to compile but cannot run the code</p>

<p>...>java -cp xSocket-2.8.14.jar SocketClient</p>

<p>produce</p>

<pre><code>import org.xsocket.connection.*;
import java.io.IOException;

public class SocketClient {

    public static void main(String[] args) {    
        try {
            IBlockingConnection bc = new BlockingConnection("127.0.0.1", 8090);
            String req = "Hello server";
            bc.write(req + "\r\n");
        } catch (IOException e) {

        }
        System.out.println("missing");
    }
}

C:\Users\Wildfire\Desktop&gt;java -cp xSocket-2.8.14.jar SocketClient.java
Exception in thread "main" java.lang.NoClassDefFoundError: SocketClient/java
Caused by: java.lang.ClassNotFoundException: SocketClient.java
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: SocketClient.java.  Program will exit.
</code></pre>
