Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D262D115D6 for ; Tue, 29 Jul 2014 10:13:29 +0000 (UTC) Received: (qmail 79837 invoked by uid 500); 29 Jul 2014 10:13:29 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 79716 invoked by uid 500); 29 Jul 2014 10:13:29 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 79700 invoked by uid 99); 29 Jul 2014 10:13:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 10:13:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jak-commons-dev@m.gmane.org designates 80.91.229.3 as permitted sender) Received: from [80.91.229.3] (HELO plane.gmane.org) (80.91.229.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 10:13:27 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XC4Oz-0005gC-9F for dev@commons.apache.org; Tue, 29 Jul 2014 12:13:01 +0200 Received: from mail.scalaris.com ([62.154.225.82]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jul 2014 12:13:01 +0200 Received: from joerg.schaible by mail.scalaris.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jul 2014 12:13:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: dev@commons.apache.org From: =?UTF-8?B?SsO2cmc=?= Schaible Subject: Re: [Commons Wiki] Update of "MavenAndClasspath" by sebbapache Date: Tue, 29 Jul 2014 12:12:46 +0200 Organization: Swiss Post Solutions Lines: 46 Message-ID: References: <20140729055954.82839.26306@eos.apache.org> <4004b033a1c0f6277b162778cf9c8c67@scarlet.be> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: mail.scalaris.com User-Agent: KNode/4.12.5 X-Virus-Checked: Checked by ClamAV on apache.org Gilles wrote: >> [...] >> >> == Java classloader == >> >> The Java runtime system only allows a single instance of a class to >> exist in a given classloader. >> Classes are uniquely identified using the package name and class >> name. >> >> For example, the class {{{Utils}}} in the package >> {{{org.apache.commons.example}}} can only appear once in a >> classloader. >> >> The classloader uses the classpath to find the classes needed by an >> application. >> >> If the classpath contains more than one jar which contains the above >> Utils class, then the JVM will load only one of the instances. >> >> If the class instances in the different jars are identical, then this >> is not a problem, but if there are two different versions of the >> class, the classloader may choose the wrong one. And different JVMs >> may process the classpath in a different order. > > Is that correct? > > Excerpt from > http://docs.oracle.com/javase/8/docs/technotes/tools/unix/classpath.html: > ----- > The order in which you specify multiple class path entries is > important. > The Java interpreter will look for classes in the directories in the > order they appear in the class path variable. > ----- > > Gilles > >> [...] If your jars are in the WEB-INF/lib folder of a web application ... do you know in which sequence the application server adds those jars to the classpath ?? - Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org