Search code examples
javaeclipsejsptypesimporterror

The import cannot be resolved in JSP


Before posting this message I read tens of threads but with no success. I am trying to import a package into one of my JSP files and I keep getting the same error:

The import cannot be resolved.

I believe that something is not right with my project structure. I have tried everything, from cleanup, rebuild, even creating another project from scratch.

This is the structure of my project:

Project structure

And these are the contents of my build path:

Build path 1

Libraries build path

I would greatly appreciate any kind of help, this is a big blocker right now for me.


Solution

  • Yes, it's your project structure. Your source files are not actually under the src folder that would be listed on the Source tab of the Java Build Path property page you're showing (you can see how it's laid out that folder's contents to resemble package names). Either move the files to where they're expected or update the Source tab to point to where you're actually keeping them.