8

I am facing a weird issue. When I add some external JARs to the classpath I get the error "It is indirectly referenced from required .class files". But when I remove all of them I get rid of this error. Here re the entries for .classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="bundle/src/main/java"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="lib" path="C:/external_jars/cq-wcm-api-5.7.8.jar"/>
    <classpathentry kind="lib" path="C:/external_jars/cq-wcm-commons-5.7.8.jar"/>
    <classpathentry kind="lib" path="C:/external_jars/cq-wcm-core-5.7.116.jar"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

Do let me know if I need to provide any other info.

Thanks in advance

user972418
  • 817
  • 3
  • 25
  • 58
  • possible duplicate of [Eclipse error: indirectly referenced from required .class files?](http://stackoverflow.com/questions/5547162/eclipse-error-indirectly-referenced-from-required-class-files) – MyPasswordIsLasercats Apr 24 '15 at 13:47
  • 2
    What is the complete error message – Chetan Kinger Apr 24 '15 at 13:47
  • possible duplicate of [Indirectly referenced from required .class file](http://stackoverflow.com/questions/115971/indirectly-referenced-from-required-class-file) – davide Apr 24 '15 at 13:52

3 Answers3

6

That error means you have some unresolved dependency, i.e. one of those jar files depends on some other jar file that you have not added to your classpath.

I believe this is a duplicate of: Eclipse error: indirectly referenced from required .class files?

Community
  • 1
  • 1
Josh Davis
  • 1,793
  • 1
  • 15
  • 21
1

one of the class that you use needs another class which is not in classpath.Just add the required jar to the classpath.Also clean the workspace.Missing file's name will be in the error message.

Shayan Ghosh
  • 882
  • 6
  • 14
0

For me, after changing a dependency in pom.xml file,this kind of error started showing up.Maven repository was corrupted.So deleted the.m2 repository and updated maven.Refered this answer:

https://stackoverflow.com/a/46582952/10082325

Mutaealim
  • 127
  • 11