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条回答
够拽才男人
2楼-- · 2019-01-02 23:37

Point the JRE in the Build path to a JDK. That worked for me.

查看更多
ら.Afraid
3楼-- · 2019-01-02 23:40

It means: "A class that you use needs another class that is not on the classpath." You should make sure (as Harry Joy suggests) to add the required jar to the classpath.

查看更多
时光不老,我们不散
4楼-- · 2019-01-02 23:40

I had this error because of a corrupted local maven repository.

So, in order to fix the problem, all I had to do was going in my repository and delete the folder where the concerned .jar was, then force an update maven in Eclipse.

查看更多
叼着烟拽天下
5楼-- · 2019-01-02 23:40

I got the error when I just changing some svn settings and not anything in the code. Just cleaning the projects fixed the error.

查看更多
Anthone
6楼-- · 2019-01-02 23:40

In addition to the already suggested cause of missing a class file this error can also indicate a duplicate class file, eclipse reports this error when an class file on the build path uses another class that has multiple definitions in the build path.

查看更多
Ridiculous、
7楼-- · 2019-01-02 23:40

In my case it was a result of my adding a new dependency to my pom.xml file.

The new dependency depended on an old version of a library (2.5). That same library was required by another library in my pom.xml, but it required version 3.0.

For some reason, when Maven encounters these conflicts it simply omits the most recent version. In Eclipse when viewing pom.xml you can select the "dependency hierarchy" tab at the bottom to see how dependencies are resolved. Here you will find if the library (and thus class) in question has been omitted for this reason.

In my case it was as simple as locking down the newer version. You can do so by right-clicking the entry - there is an option to lock it down in the context menu.

查看更多
登录 后发表回答