Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22981

Re: help: class conflict in two different version JAR files

X-Received by 10.224.131.193 with SMTP id y1mr3604096qas.8.1363791012992; Wed, 20 Mar 2013 07:50:12 -0700 (PDT)
X-Received by 10.49.3.42 with SMTP id 10mr589878qez.23.1363791012955; Wed, 20 Mar 2013 07:50:12 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!t2no5739573qal.0!news-out.google.com!k8ni4137qas.0!nntp.google.com!dd2no3740149qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Wed, 20 Mar 2013 07:50:12 -0700 (PDT)
In-Reply-To <3ef61613-19c4-42d5-a9bb-82c2d9b4b8cd@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=140.90.91.122; posting-account=oo44OQoAAABMDvaRlaO3SeQ5MVbxqLdH
NNTP-Posting-Host 140.90.91.122
References <3ef61613-19c4-42d5-a9bb-82c2d9b4b8cd@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <e81af975-00ad-4f92-9c47-443d11c05b60@googlegroups.com> (permalink)
Subject Re: help: class conflict in two different version JAR files
From zyng <xsli2@yahoo.com>
Injection-Date Wed, 20 Mar 2013 14:50:12 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.lang.java.programmer:22981

Show key headers only | View raw


On Wednesday, March 20, 2013 10:34:47 AM UTC-4, zyng wrote:
> I am using Eclipse. Project A uses 3rdparty.1.0.1.jar file; Project B uses 3rdparty.1.0.3.jar file. Project B depends on Project A.
> 
> 
> 
> I am working on Project B. I am not supposed to change anything in Project A. I hope that the code in B always use the class inside 3rdparty.1.0.3.jar. I don't know how to do that. I found that for the classes in 3rdpartyxx.jar, the code in B just use the class in 3rdparty.1.0.1.jar file, which is used by A. I guess since B depends on A, so 3rdparty.1.0.1.jar file has the higher priority. This causes some problem, which I just omit here.
> 
> 
> 
> If running by ANT on the command line, due to the way I set up(project A's code listed near the end of the Java classpath), the code in B uses the classes in 3rdparty.1.0.3.jar and the problem was avoided.
> 
> 
> 
> I hope to solve the problem in Eclipse. Thank you for your help.

Another thing I am unclear is that: in the code in Project B, in Eclipse, when I press F3 on one of the class names, it says no source attached in 3rdparty.1.0.3.jar, giving me the impression that the code is using the classes in 3rdparty.1.0.3.jar. However, when running, the code is definitely using the classes in 3rdparty.1.0.1.jar, not 3rdparty.1.0.3.jar. 

For example: In Eclipse, if I remove 3rdparty.1.0.1.jar from Project A's build path, some code of A has compiling errors. But it does not matter for this testing purpose. Now, if I run my JUNit test code in Project B, the correct classes are used and the problem was avoided.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

help: class conflict in two different version JAR files zyng <xsli2@yahoo.com> - 2013-03-20 07:34 -0700
  Re: help: class conflict in two different version JAR files zyng <xsli2@yahoo.com> - 2013-03-20 07:50 -0700
    Re: help: class conflict in two different version JAR files Lew <lewbloch@gmail.com> - 2013-03-20 12:16 -0700
  Re: help: class conflict in two different version JAR files Lew <lewbloch@gmail.com> - 2013-03-20 12:14 -0700
  Re: help: class conflict in two different version JAR files Arne Vajhøj <arne@vajhoej.dk> - 2013-03-20 22:11 -0400
  Re: help: class conflict in two different version JAR files Roedy Green <see_website@mindprod.com.invalid> - 2013-03-20 20:32 -0700

csiph-web