静态初始化块中的stream无法停止。。
把这段内容移动到main中就没有问题。jdk1.8.0_144,不用IDE用纯java命令也试过了。百撕不得骑姐。
    public static void main(String[] args) {    }    static {
        List<Integer> ints = Arrays.asList(1, 2, 3, 4, 5);
        List<String> s = ints.parallelStream()
                .map(i -> i.toString())
                .collect(Collectors.toList());        System.out.println(s);
    }

解决方案 »

  1.   

    https://stackoverflow.com/questions/34820066/why-does-parallel-stream-with-lambda-in-static-initializer-cause-a-deadlock
      

  2.   


    stackoverflow还真是牛B呀。看来还记基础支持不行。居然不知道初始化死锁问题。
      

  3.   

    你好  看你之前有个关于Exception in thread "main" 
    Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
    内存的问题  你发的帖子没看懂   我现在也遇到了这个问题能给我改下吗
    qq1695873323收到请回复谢谢