wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes package javax.servlet.jsp.tagext does not exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "package javax.servlet.jsp.tagext does not exist" Watch "package javax.servlet.jsp.tagext does not exist" New topic
Author

package javax.servlet.jsp.tagext does not exist

Denise Advincula
Ranch Hand

Joined: Jan 01, 2007
Posts: 160
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!


SCJP/OCPJP 6 | SCWCD/OCPJWCD 5 | OCMJEA in progress...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Denise Advincula
Ranch Hand

Joined: Jan 01, 2007
Posts: 160
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

Joined: Feb 28, 2011
Posts: 3
I am also having the same issue. Will you please explain it in detail ?
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1687
    
  25

How is your project setup?
Please provide more information

Regards
Frits
sanjay kankariya
Greenhorn

Joined: Feb 28, 2011
Posts: 3
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
Bartender

Joined: Apr 07, 2010
Posts: 1687
    
  25

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
 
GeeCON Prague 2014
 
subject: package javax.servlet.jsp.tagext does not exist