I have the following line in a maven project in netbeans.
Projection projection = two.translate(Vector.reg1).projection(direction);
two is a Shape instance.
public abstract class Shape {
public double mass;
public double momentOfIntertia;
public Vector center;
public abstract List<Edge> normals(Vector direction);
public abstract Projection projection(Vector line);
public abstract Shape transform(Transformation transformation);
public abstract Shape translate(Vector translation);
public abstract void render(Graphics graphics);
}
and when I compile I get this error.
[ERROR]BUILD FAILURE
------------------------------------------------------------------------
Compilation failure
org/curious/pounce/Collision.java:[89,39] cannot find symbol
symbol : method translate(org.curious.pounce.math.Vector)
location: class org.curiou开发者_StackOverflow中文版s.pounce.Shape
I'm not sure what can be wrong with this, if anything was wrong netbeans should be pointing out the error in the IDE, which it isn't.
Try running a clean on all projects involved (in maven, assuming that's where the message is from).
You can try doing mvn clean
and then building again.
I had the same problem: Netbeans indicates a invalid method but he was there! I tried several ways to resolve this issue without success. So, i upload manually the jar archive into dependence of project: right-click on dependency, right-click on jar-archive, install artifact manually.
I had this problem just now. For me, the symbol is in a package, and I'm using maven to manage the code.
Just running:
mvn clean install
didn't help me, Then I ran:
mvn idea:clean idea:idea
After this, I found the symbol disappeared, which means the code I saw is not the code I was using. So I think maybe it is because the IntelliJ didn't update the code, which leads to this confusion.
精彩评论