简体   繁体   English

Intellij IDEA 12无法编译简单代码

[英]Intellij IDEA 12 Can not compile simple code

I'm new to Java, I'm trying to compile the simplest code: hello world , 我是Java的新手,我正在尝试编译最简单的代码: hello world

package com.ninet.first;

public class Test {
    public static void main(String[] param) {
        System.out.println("test");
    }
} 

when i run it, it says: 当我运行它时,它说:

COMPILATION COMPLETED WITH 1 ERROR 0 WARNINGS
ERROR: FAILED TO CREATE A SELECTOR

no class is created. 没有创建类。 i have followed couple video tutorials how to use intellij, did everything as in the tutorials, tried to re install IDE many times, no changes!! 我已经按照几个视频教程如何使用intellij,做了教程中的所有内容,尝试重新安装IDE多次,没有变化! Project SDK are set, I'm using 1.6 项目SDK已设置,我正在使用1.6

By the way i have no problems in Eclipse. 顺便说一句,我在Eclipse中没有任何问题。 I can also compile and run my classes in command line. 我也可以在命令行中编译和运行我的类。

Take a look at IDEA-98407 , does that solve your problem? 看看IDEA-98407 ,这可以解决您的问题吗? Quote: 引用:

Then you'll have to turn off Settings | 然后你必须关闭设置| Compiler | 编译器| Use external build. 使用外部构建。

Please check this Knowledge Base document for the networking related issues. 查看此知识库文档以了解与网络相关的问题。

Also check my answer here . 请在这里查看我的答案

Compiler works in a separate process, hence the requirement for the network connection for the IPC, however it's not normal that your firewall is blocking connections on local interface (127.0.0.1) by default. 编译器在单独的进程中工作,因此需要IPC的网络连接,但是默认情况下防火墙阻止本地接口(127.0.0.1)上的连接是不正常的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM