aspose file tools*
The moose likes Tomcat and the fly likes Need of copying jars from Tomcat to JDK Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Need of copying jars from Tomcat to JDK" Watch "Need of copying jars from Tomcat to JDK" New topic
Author

Need of copying jars from Tomcat to JDK

Faraz Ka
Ranch Hand

Joined: Jun 01, 2013
Posts: 53
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
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42640
    
  65
There is no need to do so. Why do you think there is?


Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

In fact, not only is there no need to do so, you should never do so.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Faraz Ka
Ranch Hand

Joined: Jun 01, 2013
Posts: 53
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
Marshal

Joined: Mar 22, 2005
Posts: 42640
    
  65
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

Joined: Jun 01, 2013
Posts: 53
Thanks Ulf!
Faraz Ka
Ranch Hand

Joined: Jun 01, 2013
Posts: 53
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Faraz Ka
Ranch Hand

Joined: Jun 01, 2013
Posts: 53
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need of copying jars from Tomcat to JDK