Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/ref/FinalReference
<p>I am a student in IT and i'm still learning java and android developement.<br>
i'm testing with some udp traffic between a desktop app and a android app.
but every time I try to run the android app it gives this error message :</p>

<p>Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/ref/FinalReference</p>

<p>this is the code of the UDP client </p>

<pre><code>    import java.io.IOException;

    import java.net.DatagramPacket;
    import java.net.DatagramSocket;
    import java.net.SocketAddress;

    import android.app.Activity;
    import android.util.Log;

    public class Client extends Activity {
    public static void main(String[] args) throws IOException {
    try {
    int bufSize = 4096;
    int port = 12345;
    DatagramSocket sock = new DatagramSocket(port);
    sock.setReceiveBufferSize(bufSize);
    byte[] buffer = new byte[bufSize];

    while (true) {
        DatagramPacket p = new DatagramPacket(buffer, bufSize);
        sock.receive(p);
        Log.d("Client", "Received: " + new String(p.getData()));
    }
    }finally{}
    }
    }
</code></pre>

<p>the code may contain some parts that may not work, but it gives no errors. </p>

<p>I just want to know why the VM won't start.</p>

<p>grtz</p>
