1

I'm using NetBeans to build my project. The version I'm using is 1.8. However, I'm trying to build it again on a computer that can only run ant 1.6.5. Is there any way to specify in Netbeans which version of ant to use?

1
  • Do not forget to upvote or choose the answer of @Yogendra as the right one if you are satisfied with it. Actually I second his answer.
    – ilango
    Commented Oct 15, 2012 at 18:21

2 Answers 2

5

Please follow 3 easy steps as below:

  1. Download Ant 1.6.5 from Apache Binaries and install/extract in your local file system

  2. Go to Netbeans Tools > Options > Miscellaneous > Ant

  3. Change the Ant Home to Ant 1.6.5 folder created in step-1 of your local file system

EDIT:

If the above doesn't help because of your specific Net Beans, try steps below:

  1. Go to Help -> Help Contents

  2. Search for Switching Ant Version

  3. Click the same link from left pane to get the details in right, you should see a screen as below:

enter image description here

Follow the instructions on the above page.

5
  • I did as you said but my build.impl.xml is still the 1.8 ant xml file. I tried deleting it for it to be regenerated but no cigar. it also doesn't compile/run - when I press run netbeans says my program is running but nothing happens.
    – wonton
    Commented Oct 15, 2012 at 21:56
  • Which version of Netbeans and Java, are you using? Commented Oct 16, 2012 at 0:19
  • Added new set of inputs. See if that helps you. Commented Oct 16, 2012 at 3:31
  • java 1.7.0_04. Netbeans 7.2 201207171143. Hmm, apparently there's an error message that occurs. java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.Input$Handler at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) .... Caused: java.lang.NoClassDefFoundError: org/apache/tools/ant/taskdefs/Input$Handler at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) at java.lang.Class.getConstructor0(Class.java:2714)
    – wonton
    Commented Oct 16, 2012 at 4:51
  • 2
    I found the setting in Tools > Options > Java > Ant in version 7.2 Commented Jul 25, 2013 at 15:51
2

In NetBeans 8.2, go to Tools -> Options -> Java -> Ant -> Ant Home

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.