Eclipse error: indirectly referenced from required

2019-01-02 23:32发布

I got an error in Eclipse. What does this error message means:

The type iglu.ir.TermVector cannot be resolved. It is indirectly referenced from required .class files

标签: eclipse
20条回答
Anthone
2楼-- · 2019-01-02 23:43

If you still can not find anything wrong with your setup, you can try Project -> Clean and clean all the projects in the workspace.

EDIT: Sorry, did not see the suggestion of verbose_mode ... same thing

查看更多
Rolldiameter
3楼-- · 2019-01-02 23:44

Quickly and Simply I fixed it this way ( I use ADT version: v21.0.0-531062 on Windows XP home edition)

  1. Opened manifest file.
  2. Changed the Existing project minSdkVersion to the same value as maxSdkVersion ( advise: it may be good to create a New project and see what is it's maxSdkVersion )
  3. Save manifest file.
  4. Right Click the project and select Build Project.
  5. From top menu: Project - Clean.. - check Only the relevant project, below I checked Start a build immediately and Build only the selected projects and OK.
  6. open the java file - NO red errors anymore !
  7. Back to step 1 above and changing Back minSdkVersion to it's Original value (to supoprt as many Android version as possible).

It worked BUT the problem returns every few days. I do the same as above and it solves and lets me develop.

查看更多
乱世女痞
4楼-- · 2019-01-02 23:45

When i use a new eclipse version and try to use the previous workspace which i used with old eclipse version, this error occured.

Here is how i solve the problem:

Right click my project on Package Explorer -> Properties -> Java Build Path -> Libraries -> I see an error(Cross Sign) on JRE System Library. Because the path cannot be found. -> Double click the JRE System Library -> Select the option "Workspace Default JRE" -> Finish -> OK. -> BUM IT IS WORKING

FYI.

查看更多
乱世女痞
5楼-- · 2019-01-02 23:46

What fixed it for me was right clicking on project > Maven > Update Project

查看更多
ら.Afraid
6楼-- · 2019-01-02 23:49

For me, it happens when I upgrade my jdk to 1.8.0_60 with my old set of jars has been used for long time. If I fall back to jdk1.7.0_25, all these problem are gone. It seems a problem about the compatibility between the JRE and the libraries.

查看更多
Lonely孤独者°
7楼-- · 2019-01-02 23:49

Since you give us very little details, most likely what you did, which is an incredibly easy mistake to make, is that instead of heading to

Build Path > Configure Build Path > Projects

and adding your additional project folder from there, instead you went to

Build Path > Configure Build Path > Libraries

and added your project folder from there instead.

This is most definitely the case if your code is all correct, but upon automatically reorganizing imports via the ctrl+space shortcut , instead of your import statements referring to com.your.additionalproject, your references all point to bin.com.your.additionalproject.

Note the bin. Meaning that you -are- indirectly referring to your class by treating your other project folder structure as a library, making your IDE doing all the wokr of finding the exactly binary class you're referring to.

To correct this, remove the folder from the Libraries, and instead add it under the Projects tab, and reorganize your imports. Your project should work fine.

查看更多
登录 后发表回答