Software Development

How to fix the missing Tag Library Descriptor error for JSTL core in Eclipse or IntelliJ?

BR Asked by Brendan Rogers · 10-11-2024
0 upvotes 6,010 views 0 comments
The question

I am getting a frustrating error in my JSP file stating "Can not find the tag library descriptor for http://java.sun.com/jsp/jstl/core". I have added the dependency to my pom.xml, but the server still won't recognize the URI. This is happening in a legacy Java web project I'm trying to modernize. Does anyone know if this is a classpath issue, or do I need to manually add the TLD files to my WEB-INF folder to get the core tags working again?

3 answers

0
ME
Answered on 12-11-2024

This error usually occurs because the JSTL library is not present in the runtime classpath of your container, even if it is in your IDE. If you are using Maven, ensure you have both the jstl and standard dependencies, or the modern jakarta.servlet.jsp.jstl if you are on a newer server. Most importantly, check that your web.xml version matches the JSTL version you are using. For older projects, you might need to ensure the JAR files are physically located in /WEB-INF/lib, as some older versions of Tomcat do not automatically scan external Maven libraries unless configured to do so.

0
ST
Answered on 14-11-2024

Are you using a specific Application Server like GlassFish or just a plain Tomcat instance? Sometimes the server provides these libraries out of the box, and adding them again causes a conflict.

JE 15-11-2024

If you are using Tomcat, it does not include JSTL by default. You should download the JSTL 1.2 JAR and place it in the lib folder. Also, make sure your URI is exactly "http://java.sun.com/jsp/jstl/core" and not the version with the "jakarta" prefix unless you have migrated your entire project to the Jakarta namespace, as mixing them will definitely cause a TLD search failure.

0
RE
Answered on 16-11-2024

I found that updating the Project Facets in Eclipse to match the correct Dynamic Web Module version often resolves these phantom TLD errors.

RE 17-11-2024

That is a great point, Jeffrey. I’ve had the same issue where the IDE's internal validation was stricter than the actual compiler. Updating the facets usually clears the red markers instantly.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session