开发者

cannot find symbol(it's there...)

开发者 https://www.devze.com 2023-02-15 11:32 出处:网络
I have the following line in a maven project in netbeans. Projection projection = two.translate(Vector.reg1).projection(direction);

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消