简体   繁体   English

在Maven上使用println没有输出到控制台

[英]No output to console with println on maven

So whenever I build and test my maven package i am not getting an output and the program auto closes, I have tried this on Eclipse and Netbeans and still no heed, thanks in advance and the code is below: 因此,每当我构建和测试我的Maven软件包时,我都不会得到输出,并且程序会自动关闭,我已经在Eclipse和Netbeans上尝试了此操作,但仍然没有注意,在此先感谢,下面的代码是:

public static void main(String[] args) {
    // TODO Auto-generated method stub

    Boolean end = false;
    while(end = false){
    System.out.println("Enter your command(for list of commands press h): ");
    Scanner scanner = new Scanner(System.in);
    String command = scanner.nextLine();
    if(command == "h"){
        System.out.println("start   starts basic program");
        System.out.println("start1  starts twitter based program(in development)");
        System.out.println("api     sets api");
        System.out.println("time     sets check time");

    }else if( command == "start"){
        mainmethod();
    }else if(command == "time"){

    }else if( command == "end"){
                end = true;
            }
    }


}

your code means: 您的代码意味着:

while(false){.....} 

Please change from: 请更改为:

while(end = false){
......
}

into: 变成:

while(end == false){
......
}

它是“ ==”而不是“ =”。end == false

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

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