简体   繁体   中英

System.out.println not outputting to console

I've been using Sop to try and debug some code, and its not writing anything to the console. I thought that I just wasn't reaching the point in the code where I had it written, but I then added it to another piece of code where I knew for a fact was being executed. I have it in here:

  public MainMenuUI(MainMenuCntl theCreatingCntl) {
    theCreatingCntl = theMainMenuCntl;
    System.out.println("MMUIConstructor");
    initComponents();
    this.pack();
    this.setVisible(true);
}

The MainMenuUI pops up as expected, but the sop does nothing. Any help would be greatly appreciated.

You need to run your program with the java command instead of javaw . Here are the differences :

The java command starts a Java application. It does this by starting a Java runtime environment, loading a specified class, and calling that class's main method.

The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you do not want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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