Category Archives: classpath

java.lang.object cannot be resolved / javax.cache.Cache cannot be resolved. It is indirectly referenced from required .class files

Problem Statements :
Description
Location
Type
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
line 1
Java Problem
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project
Unknown
Java Problem
The method myMethod(SomeClass) from the type MyOtherClass refers to the missing type (insert java type here: InputStream|File|Vector|IOException|etc)
line 123
Java Problem

Solutions : 

  • Close the project and reopen it.
  • Clean the project (It will rebuild the buildpath hence reconfiguring with the JDK libraries)
    OR
  • Delete and Re-import the project and if necessary do the above steps again.
The following steps could help:
  1. Right-click on project » Properties » Java Build Path
  2. Select Libraries tab
  3. Find the JRE System Library and remove it
  4. Click Add Library… button at right side » Add the JRE System Library (Workspace default JRE)

Add this  entry in your POM.xml file


Preview:


<dependency>

<groupId>javax.cache</groupId>

<artifactId>cache-api</artifactId>

</dependency>

72 total views, no views today

Maven dependencies Nature is not working in Eclipse

If you have enable the maven nature enables via eclipse and still 

All maven dependencies are not loading and its not showing up in the libraries then.

Add this entry in your classpath file of project .
Just after JRE entry in your classpath file.

1. Ctrl+Shift+R to open up resource .
2. search .classpath
3 .add entry after JRE.

<classpathentry kind=”con” path=”org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER”/>

76 total views, no views today