Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    0

    Default Build java projects with ant

    Hi!

    I need help to build java projects with ant.
    This java projects where created with netbeans. If I build them using netbeans everything works fine... Building via ant commands works, but then my application fails to start: "Exception in thread "main" java.lang.NoClassDefFoundError".
    I already realized (I think) that it is main-class and class-path problems.

    I made two experiences and compare the results:
    1 - build with netbeans and then distribute
    2 - build and distribute by ant command

    At my final folder I got:
    1 - MyProject/jars with MyProject.jar and every projects and libraries dependencies
    2 - MyProject/ with every projects dependencies (but no libraries dependencies) and jars folder with only MyProject.jar

    I unpacked both MyProject.jar files and manifest content was:
    1 - it includes class-path (with all dependencies) and main-class
    2 - it includes main-class but no class-path

    I already follow up a lot of suggestions but with no result. Maybe it's me that is doing something wrong. But I am completely lost on this so I would appreciate some help.
    What I am looking for, and I don't know if that is possible, is for some command line solution via ant parameters or something. Because MyProject is not that simple, it has a lot of other project dependencies, and change build.xml (or others) for all of them it would be slow...

    Thanks in advance.
    Last edited by taniamagalhaes; 08-06-2013 at 04:28 PM.

Similar Threads

  1. Projects in Java
    By Gousia in forum Threads and Synchronization
    Replies: 18
    Last Post: 04-21-2011, 11:58 AM
  2. Java projects
    By srishti in forum Java Software
    Replies: 4
    Last Post: 10-04-2009, 09:02 AM
  3. Replies: 2
    Last Post: 04-03-2009, 03:03 PM
  4. Java Projects
    By Zeke886 in forum New To Java
    Replies: 0
    Last Post: 11-14-2007, 08:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •