• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

package javax.servlet.jsp.tagext does not exist

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am also having the same issue. Will you please explain it in detail ?
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic