Get java.lang.NoSuchMethodError when running simple codes
<p>I have the following JAVA code. It compiles fine, but when I run it, I got the following error:</p>

<p>Exception in thread "main" java.lang.NoSuchMethodError: Edge.(LVertex;D)V
    at Test.main(Test.java:27)</p>

<p>Any clue? Thanks in advance!</p>

<pre><code>import java.util.ArrayList;


class Vertex{
    public int key;
    public ArrayList&lt;Edge&gt; edges;
    public double minDistance = Double.POSITIVE_INFINITY;

    public Vertex(int key) {
        this.key = key;
        edges = new ArrayList&lt;Edge&gt;();
    }
}

class Edge{
    public Vertex target;
    public double weight;

    public Edge(Vertex t, double w) {
        target = t;
        weight = w;
    }
}

public class Test {
    public static void main(String[] args) {
        Edge e = new Edge(new Vertex(1), 1.0);
    }
}
</code></pre>
