use loopback address explicitly when forking external javac
authorEugene Zhuravlev <jeka@intellij.com>
Tue, 3 May 2016 12:02:54 +0000 (14:02 +0200)
committerEugene Zhuravlev <jeka@intellij.com>
Tue, 3 May 2016 12:08:37 +0000 (14:08 +0200)
jps/jps-builders/src/org/jetbrains/jps/javac/ExternalJavacManager.java

index cecdd12e411b586a816e0ce887b8a10e8d967dfd..bed7f6bf41a3bda6662c914af034c6199779db0b 100644 (file)
@@ -48,6 +48,8 @@ import org.jetbrains.jps.service.SharedThreadPool;
 
 import javax.tools.*;
 import java.io.File;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
@@ -96,8 +98,14 @@ public class ExternalJavacManager {
                                    compilationRequestsHandler);
       }
     });
-    myChannelRegistrar.add(bootstrap.bind(listenPort).syncUninterruptibly().channel());
-    myListenPort = listenPort;
+    try {
+      final InetAddress loopback = InetAddress.getByName(null);
+      myChannelRegistrar.add(bootstrap.bind(loopback, listenPort).syncUninterruptibly().channel());
+      myListenPort = listenPort;
+    }
+    catch (UnknownHostException e) {
+      throw new RuntimeException(e);
+    }
   }