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 <srinivas2...@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 > > <srinivas2...@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-unsubscr...@ant.apache.org > >> For additional commands, e-mail: user-h...@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-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > >