Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

JSP cannot resolve variables in Eclipse


Level 2

Hi All,

I recently worked on an existing project in Eclipse. It looks like the JSPs cannot resolve the variables such as xssAPI, i18n, sling although <%@include file="/libs/granite/ui/global.jsp"%> is included in the JSPs and I can find these global variables are defined in global.jsp. See below.

In the pom.xml, I use the uber-jar








Do I miss something? How can I fix this issue? Of course, I can remove the red X by disabling JSP Syntax Check in Preferences -> Validations, but that is not what I want.

Thanks for the help,




4 Replies


Employee Advisor

You need to include these included JSPs in your IDE as well. I think I read once about how to do it, but that's been a while, and I don't have the reference anymore. You might want to think about migrating your overlay to HTL and Sling Models 🙂



Level 2

Thanks, Joerg, for trying to help.

Could you explain more about "include these inclued JSPs in the IDE as well"? In each JSP that uses these variables, the first line is <%@include file="/libs/wcm/global.jsp"%>, so global.jsp is already includes in the JSPs. In my understanding, based on the maven dependence, The JSPs in Eclipse should be able to recognize these variables, right?

Thanks again,



Employee Advisor

No, the JSPs are not part of the AEM uber.jar. What you could do: Export the complete /libs path (probably you need much less, but just to be on the safe side), and place it somewhere on your local filesystem.

And then add the jcr:content/ to the build path of your Eclipse project (do not include it in your content package!!!); that should do the trick.


Level 2

The maven building is ok. There is no error for JSPs when building and deploying, The built package that includes the JSPs can run well in the website. The issue just is it shows error flat - red X within Eclipse in the JSPs that use the variables.

BTW, how to add jcr:content to the build path? are you talking about java build path? I can see all the libs there. see the pic.