Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 90629 invoked from network); 10 Oct 2009 16:01:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Oct 2009 16:01:20 -0000 Received: (qmail 31001 invoked by uid 500); 10 Oct 2009 16:01:19 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 30913 invoked by uid 500); 10 Oct 2009 16:01:18 -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 30903 invoked by uid 99); 10 Oct 2009 16:01:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Oct 2009 16:01:18 +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 (nike.apache.org: domain of groodt@gmail.com designates 209.85.218.212 as permitted sender) Received: from [209.85.218.212] (HELO mail-bw0-f212.google.com) (209.85.218.212) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Oct 2009 16:01:07 +0000 Received: by bwz8 with SMTP id 8so6701914bwz.28 for ; Sat, 10 Oct 2009 08:59:47 -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=Baf95quB7kPMdaiMCkRFI0+EHIZa8wauQCBC9keSLIk=; b=vvs57M0F7Te5MiVHvMBicjnCGd6Td/rsUKi7zN3DqLTtwHY6Vl4f9WnkA/zbpETQ40 JCuucayfjDp4BkGQH+XBMrD6nuy4+Wx1Mmc9P7Q9PWUEp80hQmsTHbXj2yiP0Q7briVz gogFN21mhEguIinWrfnod0sI3/i7U4n1rbzM0= 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=ksT2zpIxN5RK55yFb5ftAK5XsRQLv818boUzxyxcos8uT4b9QGziG981iok9zm+wOs N6zgrPBzZgFoGAk/P6zHV0zdVFe5H9DOzNQCkcNhYRUVDBkANUinpvj/mO08Y9svIfQP GEbx3KREY8l5b79qwW1LpWGyb1B9i82z5Wi60= MIME-Version: 1.0 Received: by 10.223.144.67 with SMTP id y3mr1195591fau.11.1255190387246; Sat, 10 Oct 2009 08:59:47 -0700 (PDT) In-Reply-To: <25835484.post@talk.nabble.com> References: <25835171.post@talk.nabble.com> <519c1a0c0910100830o443b8350ye27713a05ac9a4d4@mail.gmail.com> <25835266.post@talk.nabble.com> <519c1a0c0910100838o6b5ad881w8ebcd6e69512937e@mail.gmail.com> <25835392.post@talk.nabble.com> <519c1a0c0910100847oa2b9618hbe8579b4d6e21240@mail.gmail.com> <25835484.post@talk.nabble.com> Date: Sat, 10 Oct 2009 16:59:47 +0100 Message-ID: <519c1a0c0910100859n2fb254ddo7ab840c1ea851de8@mail.gmail.com> Subject: Re: Unable to run simple java file using Ant From: Greg Roodt To: Ant Users List Content-Type: multipart/alternative; boundary=0023545bf548284900047596c9c8 X-Virus-Checked: Checked by ClamAV on apache.org --0023545bf548284900047596c9c8 Content-Type: text/plain; charset=UTF-8 Yes, you can place the source somewhere else, but Im not going to tell you how. I think it would be best for you to learn how to do this yourself. Study what your existing build.xml is doing by looking at the task references here: http://ant.apache.org/manual/tasksoverview.html It would be a very simple change for you once you understand how Ant works. The same thing for the Tomcat deployment. On Sat, Oct 10, 2009 at 4:53 PM, srinivas2828 wrote: > > thats Great and thanks a lot and can we able to place source file inot src > directory using ant build script? and can you tell me how can i deploy > servlets into tomcat by using ant? > > cuberoot wrote: > > > > Your build.xml is trying to compile Java source code in ./src. You > > therefore > > need to place your Java source code in that directory. > > > > > > On Sat, Oct 10, 2009 at 4:44 PM, srinivas2828 > > wrote: > > > >> > >> No Roeseindia not in ubder src folder and should i need to place or > >> using > >> ant means build.xml file we can? and source file is called > >> Roseindia.java > >> and here is the source file > >> http://www.nabble.com/file/p25835392/Roseindia.java Roseindia.java > >> > >> > >> cuberoot wrote: > >> > > >> > Looks like nothing is being compiled. > >> > > >> > Is your Java source code under ./src? Is your Java file called > >> > Roseindia.java? Does Roseindia have no package and does it have a > >> > correctly > >> > defined main method? > >> > > >> > > >> > On Sat, Oct 10, 2009 at 4:33 PM, srinivas2828 > >> > wrote: > >> > > >> >> > >> >> thanks for your reply > >> >> Exactly, only Manifest file and there is no class file in classes > >> >> directory > >> >> also why is it so? > >> >> > >> >> cuberoot wrote: > >> >> > > >> >> > Looks like your jar is only created with the manifest and no > >> compiled > >> >> > Class > >> >> > files. Can you confirm if there are any Class files in the jar? > Does > >> >> the > >> >> > code compile successfully into ./build/classes? > >> >> > > >> >> > > >> >> > On Sat, Oct 10, 2009 at 4:23 PM, srinivas2828 > >> >> > wrote: > >> >> > > >> >> >> > >> >> >> Hi I am trying to use ant to compile and run a simple java file > got > >> >> the > >> >> >> following error > >> >> >> Buildfile: build.xml > >> >> >> > >> >> >> clean: > >> >> >> [delete] Deleting directory > >> >> >> /home/miriyala/Desktop/Roseindia/build/classes > >> >> >> [delete] Deleting directory > >> >> /home/miriyala/Desktop/Roseindia/build/jar > >> >> >> [delete] Deleting directory > >> /home/miriyala/Desktop/Roseindia/build > >> >> >> > >> >> >> prepare: > >> >> >> [mkdir] Created dir: /home/miriyala/Desktop/Roseindia/build > >> >> >> [mkdir] Created dir: > >> /home/miriyala/Desktop/Roseindia/build/classes > >> >> >> [mkdir] Created dir: /home/miriyala/Desktop/Roseindia/build/jar > >> >> >> > >> >> >> compile: > >> >> >> > >> >> >> jar: > >> >> >> [jar] Building MANIFEST-only jar: > >> >> >> /home/miriyala/Desktop/Roseindia/build/jar/Roseindia.jar > >> >> >> > >> >> >> run: > >> >> >> [java] Exception in thread "main" > >> java.lang.NoClassDefFoundError: > >> >> >> Roseindia > >> >> >> [java] Caused by: java.lang.ClassNotFoundException: Roseindia > >> >> >> [java] at > >> >> java.net.URLClassLoader$1.run(URLClassLoader.java:200) > >> >> >> [java] at > >> java.security.AccessController.doPrivileged(Native > >> >> >> Method) > >> >> >> [java] at > >> >> >> java.net.URLClassLoader.findClass(URLClassLoader.java:188) > >> >> >> [java] at > >> >> java.lang.ClassLoader.loadClass(ClassLoader.java:307) > >> >> >> [java] at > >> >> >> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) > >> >> >> [java] at > >> >> java.lang.ClassLoader.loadClass(ClassLoader.java:252) > >> >> >> [java] at > >> >> >> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) > >> >> >> [java] Could not find the main class: Roseindia. Program will > >> >> exit. > >> >> >> [java] Java Result: 1 > >> >> >> > >> >> >> main: > >> >> >> [echo] main target completed.. > >> >> >> > >> >> >> BUILD SUCCESSFUL > >> >> >> Total time: 0 seconds > >> >> >> > >> >> >> Here is the build.xml file > >> >> http://www.nabble.com/file/p25835171/build.xml > >> >> >> build.xml > >> >> >> thanks in advance > >> >> >> -- > >> >> >> View this message in context: > >> >> >> > >> >> > >> > http://www.nabble.com/Unable-to-run-simple-java-file-using-Ant-tp25835171p25835171.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 > >> >> >> > >> >> >> > >> >> > > >> >> > > >> >> > >> >> -- > >> >> View this message in context: > >> >> > >> > http://www.nabble.com/Unable-to-run-simple-java-file-using-Ant-tp25835171p25835266.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 > >> >> > >> >> > >> > > >> > > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/Unable-to-run-simple-java-file-using-Ant-tp25835171p25835392.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 > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Unable-to-run-simple-java-file-using-Ant-tp25835171p25835484.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 > > --0023545bf548284900047596c9c8--