Java 7 prevents FTP transfers on Windows when firewall is on

Experiencing problems with Java 7 and FTP transfers? You’re not alone since a nasty bug has slipped in to the seventh installment of Java and it’s causing major problems for its users.

The problem consists of the FTP command PORT in conjunction with Windows Firewall on Windows Vista and Windows 7. The firewall simply closed this connection which close the socket and the ftp-transfer fails.

This problem is especially troublesome for web developers that are using the java powered IDEs Eclipse and Netbeans. Since a simple upgrade to Java 7 will immediately cause the ftp transfers to stop working and the only remedy is to either close down (turn off) your firewall or downgrade to Java 6. Explicitly allowing the Javaw.exe process through the firewall did not solve the issue for me.

Oracle has been alerted of the issue on the 11th of August 2011, but unfortunately gave the bug a 4-Low in priority, which probably means that they don’t see the magnitude of the problem and we won’t see a fix for this issue anytime soon.

This entry was posted in tech and tagged , , , , , . Bookmark the permalink.
  • Christoph König

    Workaround: Call
                   netsh advfirewall set global StatefulFTP disable
    with administrator rights

    • Dusan Nedeljkovic

      you, sir, are a genious. THANKS A MILLION!! :)

      • Aki

         thx a lot..

    • Guest

      THANKS!

  • Alan

    Did you read the evaluation on 7077696? The explains that the issue is actually an issue in Microsoft’s firewall that stems from the JDK uses IPv4-mapped IPv6 addresses. You can disable IPv6 by running with -Djava.net.preferIPv4Stack=true. Aside from disabling IPv6 by default, we don’t have any other way of working around this issue in the JDK.

  • http://twitter.com/_nlmmln_ Digitus Impudicus

    I don’t think it’s entirely a Microsoft firewall issue.  Running Windows with the firewall off, and Java 6 I had no problem, upgraded to Java 7 and the problem appears. Other FTP including command prompt do not have the issue