Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type is known, but method refers to missing type

Tags:

java

I'm not very experienced with java and Eclipse and I'm getting the following problem:

I'm writing something like:

Point3D myPoint = myClass.myMethod(arg);

And I got the error:

the method myMethod(myType arg) refers to the missing type Point3D.

However the class Point3D is known, I can create an object of this type (Point3D) without error and I got Point3D methods from auto-completion.

like image 938
Gui Avatar asked Apr 28 '16 13:04

Gui


2 Answers

You are evidently using a different implementation of Point3D in the class where you have declared the method than where you are calling it.

Go to the declaration of myMethod and check that the import statement for Point3D in that class is the same as the import statement in the class where you are calling myMethod.

like image 172
Redtama Avatar answered Oct 29 '22 11:10

Redtama


I got same issue, I solved it by changing the order of import. I put the class which make the issue at the top of import list, after package, then the IDE(VS code) makes no alert.

like image 1
SpaceNet Avatar answered Oct 29 '22 12:10

SpaceNet