Java class loader: Difference between revisions

Content deleted Content added
rewrote article for new title: Classloader
Line 10:
{{{category|[[Category:Articles for deletion]]}}}
<!-- End of AfD message, feel free to edit beyond this point -->
'''Jar Hell''' arises in the [[Software development|development]] and deployment of [[computer program]]s written in the [[Java language]].
 
The '''Java Classloader''' is a part of [[Java Runtime Environment]] that dynamically [[Loader (computing)|load]]s [[Java class]]es into the [[Java Virtual Machine]]. Usually classes are only loaded [[on demand]].
Computer programs often make use of [[software libraries]]. A library is a collection of more or less related [[object code]]. The program may make use of external or [[third party library|third party libraries]] (that is, libraries written and provided by someone other than the author of the program) or may itself be composed, at least in part, by a number of libraries.
 
A [[software libraries]] is a collection of more or less related [[object code]].
In the [[Java language]], libraries are typically packaged in [[jar-file|Jar files]]. Libraries can contain various different sorts of objects, but for the purposes of this article the most important type of object contained in a Jar file is a [[Java class]]. A class can be thought of as a named unit of code. The [[Javaclass runtime system]]loader is responsible for locating libraries, reading their contents, and [[class loader|loading the classes]] contained within the libraries. This loading is typically done "on demand", in that it does not occur until the class is actually used by the program. A class with a given name can only be loaded '''once''' by a given [[classloader]].
 
ThisThe "classloading" process is actually fairly complicated, and is the subject of much confusion in [[software deployment]] and [[Software development|development]]. Java Forprograms ourmay purposesmake here,use theof importantexternal factor is[[third this:party library|third party libraries]] (that ais, classlibraries withwritten aand givenprovided nameby cansomeone onlyother than the author of the program) or may itself be loadedcomposed, '''once'''at least in part, by a givennumber [[classloader]]of libraries.
 
== MalfunctionJAR hell ==
 
'''Jar hell'',' is a general term used to describe all the various ways in which the classloading process can end up not working.
 
* One case is when a developer or deployer of a [[Java application]] has accidentally made two different versions of a library available to the system. This is not considered an [[error|error]] by the system. Rather, the system will load classes from one or the other library. So, a developer who thinks she has replaced a library with a new version, but who has instead simply added the new library to the list of available libraries, may be surprised to see the application still behaving as though the old library is in use, which of course, it may well be.