Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I talk Java into printing to the console under Mountain Lion?

I'm using the good old System.out.println - approach to debug my Java application. Before I upgraded to Mac OS 10.8 this worked wonderfully. Now however my console wouldn't display anything. Apparently I'm not the first one to encounter this behavior - see http://www.mac-forums.com/forums/os-x-operating-system/280577-system-out-println-not-showing-console.html.

Does any of you guys know a way?

like image 277
Maximilian Tyrtania Avatar asked Oct 07 '12 12:10

Maximilian Tyrtania


1 Answers

System.console() returns null for me with mountain lion and java 6.

We have had to change our logging in our app to use log4j to output to stdout (which used to go to system.log prior to 10.8) AND produce our own log files in ~/Library/Logs which can be seen in console.app under any version.

Doesn't appear to be a sandboxing issue as i'm not seeing any sandboxing errors. Prob more investigation needed to see what device is being handed to the jvm under 10.8. At a guess maybe its being handed /dev/null for logging by mistake?

like image 110
RampantBadger Avatar answered Oct 14 '22 22:10

RampantBadger