Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Classpath while compiling Servlet  RSS feed

 
Reghuram Variyam
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can sone one explain why we would need to provide classpath to tomcat/commom/lib/servlet-api.jar:classes when compiling a servlet(page 81 in HF book) ? My understanding was that, while compiling all classes needed for Servlet is present in java libraries.
 
Johan Pelgrim
Ranch Hand
Posts: 105
Android Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
He Reghuram...

Try finding package "javax.servlet.*" in any Java runtime environment's rt.jar... it's not there! You need a jar from your Servlet / JSP Container containing implementation classes of the Servlet / JSP API specification to be able to compile Servlets and 'run' JSP pages...

Good luck!
 
Reghuram Variyam
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!