From ant-user-return-10943-apmail-jakarta-ant-user-archive=jakarta.apache.org@jakarta.apache.org Thu Aug 02 17:36:32 2001 Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 1179 invoked by uid 500); 2 Aug 2001 17:36:32 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 1169 invoked from network); 2 Aug 2001 17:36:32 -0000 Message-ID: <20010802173634.47730.qmail@web9701.mail.yahoo.com> Date: Thu, 2 Aug 2001 10:36:34 -0700 (PDT) From: Don Taylor Subject: Re: Compile question--Class not found To: ant-user@jakarta.apache.org In-Reply-To: <40E9E4B9BEE4D211B62200A0CC3E01B06EC517@RQIEXCH> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N I don't understand what you're trying to accomplish with step 2. ant/lib is where you put your own ant tasks or the optional ant tasks. In any case, it's all ant-related. To solve your problem try compiling package B first and produce the jar file ("b-jar"). Then when compiling package A make sure b-jar is in the classpath. Then everything should be fine. -- Don --- Michael Molloy wrote: > Just started using Ant, and I can already appreciate all the work > that has > been put into it. Great tool. > > However, I'm having a bit of a problem. I've got packageA and > packageB. > packageA uses some classes in packageB. I tried the following using > ant. > > 1. Compile packageB > 2. Put the jar in ant/lib. > 3. Compile packageA. > 4. Move both jar files to my Windows 2000 development box. > 5. Issued the java command: java -cp packageB.jar;packageA.jar > MainClass > > This worked some of the time, but most of the time I got a > ClassNotFoundException: packageB/SomeClass. The class is there, > though. > > The only way I could get this to work was to move the packageB source > files > into the packageA directory and then call ant on packageA. The > resulting > single jar file packageA.jar works fine everytime. The problem is > that I use > packageB classes in other applications, so this is not an optimal > solution. > > Anyone have any suggestions? If it makes a difference, I'm compiling > everything on SuSE 7.1 with Sun JDK build 1.3.1-b24. > > Thanks for any help. > > --Michael __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/