ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srinivas2828 <srinivas2...@gmail.com>
Subject Re: Unable to run simple java file using Ant
Date Sat, 10 Oct 2009 16:06:36 GMT

thanks for your help and in this site shows deployment for application
servers like "weblogic,Jonas" but what about Tomcat?

cuberoot wrote:
> 
> 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
> <srinivas2828@gmail.com>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
>> > <srinivas2828@gmail.com>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
>> >> > <srinivas2828@gmail.com>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
>> >> >> > <srinivas2828@gmail.com>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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Unable-to-run-simple-java-file-using-Ant-tp25835171p25835659.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


Mime
View raw message