Workaround for Apache Ant Install Bug

khorimati

New Member
Can someone please help with instructions for a workaround on the Apache Ant installation bug in Windows?The snippet below describes one of three workarounds. If you are able to successfully get one of these to work, can you please share?http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696(1) Run with -Djava.net.preferIPv4Stack=true- add a firewall exception for the Java binary.(2) Run with -Djava.net.preferIPv4Stack=true (which disables IPv6 and uses AF_INET sockets exclusively)(3) Or disable stateful FTP inspection in the firewall (registry setting or netsh command)============Setup:Install Apache Ant:
  • download binary files at http://ant.apache.org/
  • navigate to this path for installation instructions: Manual > Installing Apache Ant > Getting Ant > ..follow instructions
  • move the extracted folder (containing the bin folder) inside of C:\source_code\apache-ant-1.8.3\ or directory used in %ANT_HOME% environment variable
  • Windows 7 > Control Panel > System > click "Environment Variables" button >
(remove the trailing "\" character on the environment variables)
  • under the "System Variables" section, click "Add" > Variable Name: JAVA_HOME Variable Value: C:\Program Files\Java\jdk1.7.0_02
  • under the "System Variables" section, click "Add" > Variable Name: ANT_HOME Variable Value: C:\source_code\apache-ant-1.8.3
  • under the "System Variables" section, click "Path" environment variable, click "Edit" > Variable Name: Path Variable Value: {value before editing};%JAVA_HOME%\bin;%ANT_HOME%\bin;
  • restart command prompt (Run As Administrator)
  • make sure Windows sees Apache Ant:C:\source_code\apache-ant-1.8.3>ant -versionApache Ant(TM) version 1.8.3 compiled on February 26 2012
  • navigate to http://ant.apache.org/ > Manual > Installing Apache Ant > Install Ant >
========================FTP Bug:\[code\]C:\source_code\apache-ant-1.8.3>ant -f fetch.xml -Ddest=systemBuildfile: C:\source_code\apache-ant-1.8.3\fetch.xmlpick-dest: [echo] Downloading to C:\source_code\apache-ant-1.8.3\lib...-fetch-netrexx: [ftp] getting filesBUILD FAILEDC:\source_code\apache-ant-1.8.3\fetch.xml:325: The following error occurred while executing this line:C:\source_code\apache-ant-1.8.3\fetch.xml:144: java.net.SocketException: Permission denied: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.read1(BufferedInputStream.java:273) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read(BufferedInputStream.java:254) at org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:114) at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:535) at java.lang.Thread.run(Thread.java:722)Total time: 3 secondsC:\source_code\apache-ant-1.8.3>\[/code\]==============I've tried making an inbound and outbound Windows Firewall rule to allow this program through.\[code\]%ProgramFiles%\Java\jdk1.7.0_02\bin\java.exe\[/code\]I've also tried running the command with the parameter they mention in the workaround.\[code\]C:\source_code\apache-ant-1.8.3>ant -f fetch.xml -Ddest=system -Djava.net.preferIPv4Stack=true\[/code\]
 

Asmund

New Member
khorimati said:
Can someone please help with instructions for a workaround on the Apache Ant installation bug in Windows?The snippet below describes one of three workarounds. If you are able to successfully get one of these to work, can you please share?http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696(1) Run with -Djava.net.preferIPv4Stack=true- add a firewall exception for the Java binary.(2) Run with -Djava.net.preferIPv4Stack=true (which disables IPv6 and uses AF_INET sockets exclusively)(3) Or disable stateful FTP inspection in the firewall (registry setting or netsh command)============Setup:Install Apache Ant:
  • download binary files at http://ant.apache.org/
  • navigate to this path for installation instructions: Manual > Installing Apache Ant > Getting Ant > ..follow instructions
  • move the extracted folder (containing the bin folder) inside of C:\source_code\apache-ant-1.8.3\ or directory used in %ANT_HOME% environment variable
  • Windows 7 > Control Panel > System > click "Environment Variables" button >
(remove the trailing "\" character on the environment variables)
  • under the "System Variables" section, click "Add" > Variable Name: JAVA_HOME Variable Value: C:\Program Files\Java\jdk1.7.0_02
  • under the "System Variables" section, click "Add" > Variable Name: ANT_HOME Variable Value: C:\source_code\apache-ant-1.8.3
  • under the "System Variables" section, click "Path" environment variable, click "Edit" > Variable Name: Path Variable Value: {value before editing};%JAVA_HOME%\bin;%ANT_HOME%\bin;
  • restart command prompt (Run As Administrator)
  • make sure Windows sees Apache Ant:C:\source_code\apache-ant-1.8.3>ant -versionApache Ant(TM) version 1.8.3 compiled on February 26 2012
  • navigate to http://ant.apache.org/ > Manual > Installing Apache Ant > Install Ant >
========================FTP Bug:\[code\]C:\source_code\apache-ant-1.8.3>ant -f fetch.xml -Ddest=systemBuildfile: C:\source_code\apache-ant-1.8.3\fetch.xmlpick-dest: [echo] Downloading to C:\source_code\apache-ant-1.8.3\lib...-fetch-netrexx: [ftp] getting filesBUILD FAILEDC:\source_code\apache-ant-1.8.3\fetch.xml:325: The following error occurred while executing this line:C:\source_code\apache-ant-1.8.3\fetch.xml:144: java.net.SocketException: Permission denied: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.read1(BufferedInputStream.java:273) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read(BufferedInputStream.java:254) at org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:114) at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:535) at java.lang.Thread.run(Thread.java:722)Total time: 3 secondsC:\source_code\apache-ant-1.8.3>\[/code\]==============I've tried making an inbound and outbound Windows Firewall rule to allow this program through.\[code\]%ProgramFiles%\Java\jdk1.7.0_02\bin\java.exe\[/code\]I've also tried running the command with the parameter they mention in the workaround.\[code\]C:\source_code\apache-ant-1.8.3>ant -f fetch.xml -Ddest=system -Djava.net.preferIPv4Stack=true\[/code\]

Just get the file directly from the website using your browser:
ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRexx.zip
and put it in the folder it should go:
C:\Users\<username>\.ant\tempcache (for example, check your log for where it wants to put it)

Then edit the fetch.xml file and remove lines 324 and 325 (the "get-ftp-file" tag)
Then run
ant -f fetch.xml -Ddest=system
again
 
Top