Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 38332 invoked from network); 15 Jun 2009 16:56:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jun 2009 16:56:48 -0000 Received: (qmail 45425 invoked by uid 500); 15 Jun 2009 16:56:58 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 45351 invoked by uid 500); 15 Jun 2009 16:56:58 -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 45330 invoked by uid 99); 15 Jun 2009 16:56:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 16:56:57 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of qazwart@gmail.com designates 209.85.221.185 as permitted sender) Received: from [209.85.221.185] (HELO mail-qy0-f185.google.com) (209.85.221.185) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 16:56:48 +0000 Received: by qyk15 with SMTP id 15so5208015qyk.14 for ; Mon, 15 Jun 2009 09:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=R60Nd/7c5OggNuI8kQAEc/4scQt+lDKt1yd04ksYqO8=; b=Q8WVXB2dnyGypS6nxNa/Y2PwJ9VbS3S66B5+vCvp8tTQGKRLdiz5F05+mFqrKEEeW3 8yjMYu1lASJpVbWcqo+7auzXOSkFMiwu/z7mooXko9VsHbJ9GkZHSkccn5GcyEcjoXnx D3sDKhXMQYcGQ9T8yn8MAU++GWbdmFM3anRfM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Kdo5VLq4bx5s9QO5SwVdDZKdio/fZY1PkMaX31uXfp0Pk0dcIQKldiKbRgI09ayO/t qveDRCtOt02n1Cyv0yeuG1ale+QuBr5/Bp70eaez/ORRvMdrDNGR2x11kSDFGZnPi6S8 cQ8VeuU2S5C69U9xU2bA8mZDogxk1bA659UQM= MIME-Version: 1.0 Received: by 10.224.19.209 with SMTP id c17mr7403985qab.354.1245084986953; Mon, 15 Jun 2009 09:56:26 -0700 (PDT) In-Reply-To: <24033173.post@talk.nabble.com> References: <24033173.post@talk.nabble.com> Date: Mon, 15 Jun 2009 12:56:26 -0400 Message-ID: Subject: Re: cannot find symbol From: David Weintraub To: Ant Users List Content-Type: multipart/alternative; boundary=0015175ccf305cd212046c65f0a4 X-Virus-Checked: Checked by ClamAV on apache.org --0015175ccf305cd212046c65f0a4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This isn't an Ant error as much as a "javac" command error. What you're being told is that a particular program is trying to resolve a symbol, but can't find the reference to that symbol. For example, these particular classes are defined in a jarfile called something like org.eclipse.swt.._.jar which lives in your Eclipse installation. On my system it is called org.eclipse.swt.gtk.linux.x86_64_3.4.1.v3449c.jar. On a Windows system, it might be org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar. When you run the task, you must make sure this jarfile is in the classpath. There are multiple ways of setting the classpath when you compile using the command. One is to set the "classpath" parameter itself. Another is to use a "reference" to set the classpath, and then use the classpathref parameter. This is nicer since it gives you a bit more flexibility. Here I'm defining a classpath called "class.path": Now, you can add and subtract jarfiles your build depends upon by simply adding them to the ${basedir}/lib directory. You no longer have to modify your build.xml file every time someone adds a new jarfile dependency. You can compile like this: Now, you're referencing the path "class.path" as your classpath for your "javac" command. Another way is to use a sub-task: * ** * This allows you to build more complex classpaths that might be possible with a single reference. Notice that I am using fileset, pathelement, and even a reference to a previously defined path called "class.path2". How do you compile your code now? Are you using a script? If so, what is the classpath used by the javac command in your script? That'll help you understand what should be in your classpath when you run . On Mon, Jun 15, 2009 at 7:44 AM, Hungry Snail wrote: > > Hi People. > > I am trying to compile some files with ant but am getting the following > errors. > > [javac] D:\Stats\src\org\selectbf\gui\ConfigurationDialog.java:32: package > org.eclipse.swt.widgets does not exist > [javac] import org.eclipse.swt.widgets.Text; > [javac] ^ > [javac] D:\Stats\src\org\selectbf\gui\ConfigurationDialog.java:50: package > org.eclipse.swt.widgets does not exist > [javac] public class ConfigurationDialog extends > org.eclipse.swt.widgets.Dialog > [javac] ^ > [javac] D:\Stats\src\org\selectbf\gui\ConfigurationDialog.java:53: cannot > find symbol > [javac] symbol : class Shell > [javac] location: class org.selectbf.gui.ConfigurationDialog > [javac] private Shell dialogShell; > [javac] ^ > [javac] D:\Stats\src\org\selectbf\gui\ConfigurationDialog.java:54: cannot > find symbol > [javac] symbol : class TabItem > [javac] location: class org.selectbf.gui.ConfigurationDialog > [javac] private TabItem generalTabItem; > > In total there are 100 of these errors :-o. > > As I have never used ant before, is there anything I can do to fix this? > > Thanks in advance. > -- > View this message in context: http://www.nabble.com/cannot-find-symbol-tp24033173p24033173.html > Sent from the Ant - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > -- David Weintraub qazwart@gmail.com --0015175ccf305cd212046c65f0a4--