简体   繁体   中英

Java 8, El Capitan: System.err.println() output not reaching Console.app

Coming to grips with Java 8 on El Capitan...

I used to have exceptions print their messages to System.err and they used to appear nicely in Console.app. Now they don't, and I'm stumped figuring out what's wrong.

My main() method looks like this:

public static void main(String[] args)
{
  System.err.println("Hello world");
  [...]
}

When I run the app from within my IDE, the message is output to the Run panel in the IDE. All good. When I build the app and double-click it from the Finder, nothing appears in Console.app. I've looked in System Log Queries -> All Messages, I've looked in Files -> system.log. Nothing.

My first version of this question was pretty short and sweet, figuring that System.err messages are now output somewhere other than the Console. But with an almost deafening silence in response, I'm figuring that this is not the case, and that most folks are having no problem getting output via System.err.println() .

Can some kind person please help me figure out what is wrong with my system?

UPDATE: I have now bundled the JRE into the app bundle and I still don't see anything in Console.app. I'll get a signing certificate later today and see if that makes any difference.

Turns out this capability went away with Mountain Lion and we have to use java.util.Logger nowadays. Thanks, birryre and JochenBedersdorfer :-)

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