2

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.

skiaddict1
  • 523
  • 7
  • 19
  • Still getting `System.err` messages in the console if I'm running it in the console on ElCap and Sierra. How are you running your program? – wkl Dec 28 '16 at 05:56
  • Sorry, by Console I meant Console.app. From your comment i'm assuming you mean something else??? Invoking either by double-clicking in the Finder or from command-line with `java ...` – skiaddict1 Dec 28 '16 at 07:39
  • how did you build the app? And are you sure it is running? – Jochen Bedersdorfer Dec 29 '16 at 05:26
  • Built using Oracle's appbuilder. And yes, it's running -- I can see its windows :-) – skiaddict1 Dec 29 '16 at 05:49
  • A thought: could it possibly be that the app is not signed and doesn't have a copy of the JRE bundled in it? I've been following through [Oracle's instructions](http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html) for how to bundle an app. When I got through the steps under "Bundle the JAR File into an App Package" I found that my app launched fine, so I stopped there. (I won't ever be distributing my app to anyone else.) – skiaddict1 Dec 29 '16 at 08:25

1 Answers1

0

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

skiaddict1
  • 523
  • 7
  • 19