1

There is a problem with building simple peace of code in Intellij Idea 14.

public class Main {

public static void main(String[] args) {
// write your code here
    System.out.print("test");
} }

I'm stuck on following problem:

Error:Abnormal build process termination: 
Build process started. Classpath: /C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 14.1.5/lib/jps-launcher.jar;C:/Program Files/Java/jdk1.7.0_79/lib/tools.jar;/C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 14.1.5/lib/optimizedFileManager.jar;C:/Program Files (x86)/JetBrains/IntelliJ IDEA Community Edition 14.1.5/lib/ecj-4.4.jar
Error connecting to 127.0.0.1:1081; reason: failed to create a child event loop
java.lang.IllegalStateException: failed to create a child event loop
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:81)
    at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:50)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:72)
    at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:58)
    at org.jetbrains.jps.cmdline.BuildMain.main(BuildMain.java:97)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.jetbrains.jps.cmdline.Launcher.main(Launcher.java:58)
Caused by: io.netty.channel.ChannelException: failed to open a new selector
    at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:127)
    at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:119)
    at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:97)
    at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:31)
    at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:77)
    ... 9 more
Caused by: java.io.IOException: Unable to establish loopback connection
    at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:125)
    at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:69)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:141)

Once I have compiled this code through command prompt, 'Main.class' file have been created.

Why this exception occurs in Idea?

ramil89
  • 851
  • 13
  • 22
  • http://stackoverflow.com/questions/27506788/failed-to-create-a-child-event-loop – Hong Duan Sep 26 '15 at 11:59
  • Can you retry installing intellij or the system. Can you check the run configuration of intellij. Also, can you try to run it directly via command line. – rakesh Sep 26 '15 at 12:03
  • @rakesh I have already tried to reinstall both Java and Idea, but the error continues to appear. Also I tried to run "javac Main.java" in command prompt, so 'Main.class' created successfully. – ramil89 Sep 26 '15 at 12:08
  • I think it could be happening because of port limit. Can you add these 2 lines in your windows registry. "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\MaxUserPort" (Type: DWORD; Value: 65500) "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\TcpTimedWaitDelay" (Type: DWORD; Value: 30 ) – rakesh Sep 26 '15 at 12:14

2 Answers2

1

There can be multiple causes of this. Can you try these solutions:

This might have to do with using Java 7 on windows 7 and the IP version prefs. A workaround might be to tell Java to prefer IPv4 via the JVM argument -Djava.net.preferIPv4Stack=true. You can set this config in intellij.

Or,I think it could be happening because of port limit. Can you add these 2 lines in your windows registry. "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\MaxUserPo‌​rt" (Type: DWORD; Value: 65500) "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\TcpTimedW‌​aitDelay" (Type: DWORD; Value: 30 )

rakesh
  • 602
  • 1
  • 5
  • 23
0

After I have reinstalled Windows, it became to work.

One point that I have noticed after installing on a clean OS, is that firewall demanded me to allow open port after Idea have been started.

It seems that the issue appeared to be in an antivirus software, which restricted Idea to open port and start build a project. May be antivirus added some rules in firewall, so that I was unable to build it even after antivirus was turned off.

ramil89
  • 851
  • 13
  • 22