• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Need of copying jars from Tomcat to JDK

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Experts,

I am new to Tomcat and in this regard wants to know why there is a need to copy the following jars from Tomcat lib directory to JDK lib directory.
1. servlet-api.jar
2. jsp-api.jar
3. el-api.jar
4. tomcat-dbcp.jar

Thanks,
Faraz
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no need to do so. Why do you think there is?
 
Sheriff
Posts: 67266
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In fact, not only is there no need to do so, you should never do so.
 
Faraz Ka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. Actually I am following a book where its written copy the jars, so I asked the question as I did not have any clue why? But when I read further the book says if you have included the Tomcat lib directory to the classpath then its not needed.
Can you direct me to the topic or link that talks in detail as how classes are loaded and the role of JVM?

Thanks,
Faraz
 
Ulf Dittmer
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so there are two different objectives here.

Firstly, Tomcat needs all its libraries so that it can function properly. For that, don't move around anything.

Secondly, there's your need to have some of those same libraries in your classpath during development. I advise against copying any of those libraries into the JDK directories. Rather, include them in your "-cp" option if you compile from the command line, or add them to your project if you're using Ant or an IDE. But you shouldn't alter the behavior of the core JRE by adding libraries to it.
 
Faraz Ka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf!
 
Faraz Ka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf/Bear,

I am somewhat confused here. Whats the difference between web application and JSP/Servets?
Will it be correct to say that JSPs and Servlets together constitute a web application?

Thanks,
FKA
 
Bartender
Posts: 20838
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Faraz Ka wrote:Hi Ulf/Bear,

I am somewhat confused here. Whats the difference between web application and JSP/Servets?
Will it be correct to say that JSPs and Servlets together constitute a web application?

Thanks,
FKA



It would be more correct to say that a WAR or EAR constitutes a (j2EE) web application.

The sum total of a J2EE/JEE web application is the collection of executable objects (JSPs and servlets), resources (CSS, JavaScript, images and so forth) and deployment description information (WEB-INF/web.xml) gathered together in a specific relationship and in its strictly standards-compliant form, bundled up in a ZIP file. Although many webapp servers allow using the unzipped form of all of that directly.

That, of course is what in traditional systems would be considered the "application program". Then, when you deploy the webapp to the server, you get an "application instance". Or, in some cases, multiple instances.
 
Faraz Ka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is awesome Tim!
Your explanation really helped!

What do think which book should be the best for the first timers on JSP/Servlets?

Thanks,
Faraz
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!