I am on Eclipse IDE, and I am getting this red mark on the line where I have my package written. I created this with the Spring Initializer. I just wanted to check if Spring works, but then it’d show an exception…
`Exception in thread “main” java.lang.Error: Unresolved compilation problem:
String cannot be resolved to a type
at com.thisPebbleCodes.carDealership.CarDealershipApplication.main(CarDealershipApplication.java:9)
`
package com.thisPebbleCodes.carDealership;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class CarDealershipApplication {
public static void main(String[] args) {
// SpringApplication.run(CarDealershipApplication.class, args);
}
}
I tried:
- Cleaning the project
- Deleting and re-importing the project
- I removed and added jdk 22 back again under the Modulepath in Java build path.
New contributor
Yukta Potaraju is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.