The type java.lang.Class cannot be resolved. It is indirectly referenced from required .class files

Hi,
I have the following file :
package com.yatra.extremesearch.app;

import org.apache.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;



public class ExtremeSearchApp {
	private static final Logger logger = Logger.getLogger(ExtremeSearchApp.class);
	
	public static void main(String args[]){
		
		 try {
			 logger.info("=====Starting Extreme search======");
			 new ClassPathXmlApplicationContext("classpath*:spring/root-context.xml");
			
			} catch (Exception e) {
				logger.error(e.getMessage());
			}
		}
}

Open in new window


I am using eclipse to view this project.
I get red mark at the package line.

The error is :
he type java.lang.Class cannot be resolved. It is indirectly referenced from required .class files

What is the reason for this ?

Thanks
Rohit BajajAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
I just removed entries from java build path libraries and landed myself into this trouble.

Put them back again. Your build path needs JRE/JDK entries to work properly
0
 
SurranoSystem EngineerCommented:
Do you have a JDK path properly configured in Eclipse Java properties?
0
 
Rohit BajajAuthor Commented:
I think it is properly configured.
I just removed entries from java build path libraries and landed myself into this trouble.

Anyway how do i check it ?
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Rohit BajajAuthor Commented:
how do i add the entry for jre in eclipse build path library tab
0
 
Rohit BajajAuthor Commented:
done
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.