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?

wonton
  • 7,568
  • 9
  • 56
  • 93
  • 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 Oct 15 '12 at 18:21

2 Answers2

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.

Yogendra Singh
  • 33,927
  • 6
  • 63
  • 73
  • 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 Oct 15 '12 at 21:56
  • Which version of Netbeans and Java, are you using? – Yogendra Singh Oct 16 '12 at 00:19
  • Added new set of inputs. See if that helps you. – Yogendra Singh Oct 16 '12 at 03: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 Oct 16 '12 at 04:51
  • 2
    I found the setting in `Tools > Options > Java > Ant` in version 7.2 – RustyTheBoyRobot Jul 25 '13 at 15:51
2

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

enter image description here

Matt
  • 688
  • 5
  • 12