Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 69845 invoked from network); 29 Dec 2007 19:37:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Dec 2007 19:37:09 -0000 Received: (qmail 25041 invoked by uid 500); 29 Dec 2007 19:36:51 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 24675 invoked by uid 500); 29 Dec 2007 19:36:50 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 24664 invoked by uid 99); 29 Dec 2007 19:36:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Dec 2007 11:36:50 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of david@davidwbrown.name designates 208.240.64.5 as permitted sender) Received: from [208.240.64.5] (HELO davidwbrown.name) (208.240.64.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Dec 2007 19:36:36 +0000 Received: from davidwbrown.name (davidwbrown.name [192.168.1.1]) by davidwbrown.name (Postfix) with SMTP id C594323C052 for ; Sat, 29 Dec 2007 13:36:26 -0600 (CST) From: "david" Subject: Re: Problems understanding classpath and package To: "Ant Users List" Cc: X-Originating-IP: 192.168.1.14 X-Mailer: Usermin 1.290 Message-Id: <1198956986.8056@davidwbrown.name> In-Reply-To: <004201c84a41$c56fb060$ceb31b56@andrew1> Date: Sat, 29 Dec 2007 13:36:26 -0600 (CST) X-Virus-Checked: Checked by ClamAV on apache.org Hello Andrew, try ant -p to get a look at the Ant default environment. Packaging is part of Java and not peculiar to Ant. A good tool to use when packaging and jars are a mystery is Jarscan found at: http://www.inetfeedback.com/jarscan/index.jsp Insert the following Ant target snippet into your build.xml file and run: ant -p to make sure the newly inserted target is available. If you are successful at this point then run: ant showclasspath The returned results should show the default classpath according to your machines environment. The above assumes some type of command line: Windows cmd, Linus bash terminal, Solaris korn shell, Mac command-line OS X terminal. You should also be able to perform the above using your favorite IDE: Eclipse, IDEA, Netbeans, etc. In the future to get better responses from the Ant community please initiate your email with more information such as: Ant version: 1.7.x OS: Debian 3.1 (or Windows XP SP2 or similar) JDK: 1.6.x Source: snippets only (build.xml, etc.) Logs: Ant logs, system logs, application logs (error messages, exceptions etc.) Environment: system variable values, ant properties (ex: classpath) etc. If you are fairly new to Ant then in all-likelihood you are fairly new to Java. Some good resources follow: http://courses.coreservlets.com/Course-Materials/java5.html http://mindprod.com/jgloss/jgloss.html http://www.codase.com/ http://java.sun.com/docs/books/tutorial/java/index.html http://www.javaranch.com/ http://www.javalobby.org http://www.dzone.com HTH, David. Andrew Connick wrote .. > Hello > > I am fairly new to Ant. I am trying to use it to compile java, but I am > having problems with 'package does not exist' I assume it's a classpath > issue. Although I can find plenty of advice on how to set the classpath, > I > cannot understand what it should be. > > My directory structure is something like > - classes > - base > - A.java > - forms > - B.java > - build.xml > - lib > > The first two lines of classes\forms\B.java are: > package tags; > import base.*; > > When I try to compile this with Ant, I get 'package does not exist'. My > understanding of the documentation is that I should not need any classpath > because it's the basedir. Also, if I run "ant -verbose" I see the following: > [javac] '-classpath' > [javac] 'C:\My Web Sites\CMS\V2\WEB-INF\classes;C:\Program Files\Apache > Software....... > > If I run javac from the command line, with directory set to "classes" > it is > fine. > > My classes\build.xml is: > > > > > > > > > > > > > > > > > > > Regards > Andrew Connick > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org