Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

package javax.servlet.jsp.tagext does not exist  RSS feed

 
Denise Advincula
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

This is my code (as seen in HSFJ):



It's in this folder: Tomcat/webapps/scwcd-ctags2/WEB-INF/src/foo/SimpleTagTest1.java

I placed all the jar library files at Tomcat/webapps/scwcd-ctags2/WEB-INF/lib, namely, jsp-api.jar, jstl.jar, servlet-api.jar, standard.jar

But I still get that error, "package javax.servlet.jsp.tagext does not exist", whenever I do any of the ff javac from the scwcd-ctags2 directory:



Can anybody tell me if there is still lacking in my compilation?

Thank you in advance!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65898
135
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Denise Advincula wrote:I placed all the jar library files at Tomcat/webapps/scwcd-ctags2/WEB-INF/lib, namely, jsp-api.jar, jstl.jar, servlet-api.jar, standard.jar

Firstly, this is the run-time location for jars. It has nothing to do with javac or compiling your sources.

Secondly, once you get everything compiled, the fact that you moved the servlet and JSP jars into WEB-INF/lib will cause no end of weird errors. Remove them from WEB-INF lib.



You need to add the jar files to your classpath, not just the folder where the jars files sit.
 
Denise Advincula
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! Thanks a lot. Now my compilation worked. It's right that I need to add the jar files explicitly in my javac.
 
sanjay kankariya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also having the same issue. Will you please explain it in detail ?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2921
205
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is your project setup?
Please provide more information

Regards
Frits
 
sanjay kankariya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frits,

I tried using javac (from my project directory) command with explicitely defining jsp-api.jar in it. It worked.

javac -classpath C:\Archana\Tomcat5.5\common\lib\jsp-api.jar;classes:. -d WebContent/WEB-INF/classes src/mytags/HelloWorld
.java

Thanks a lot.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2921
205
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried using javac (from my project directory) command with explicitely defining jsp-api.jar in it. It worked.

Great!

Thanks for posting the answer so that others know how to fix it when they encounter the same problem.

Regards,
Frits
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!