2010-10-22

Java Console for Linux

From here:


Johan Dahl, 2008-09-01:


A workaround


In gnome: Select System > Settings Sun Java x.x Control Panel

In terminal: jcontrol


  1. Select the tab advanced.
  2. Expand the node "Java-console"
  3. Select show console (default is hide)

Now will the console show up the first time you run an applet. You can keep it open for debugging etc.

If you close the console window must you restart your browser to make it pop-up again.

2010-02-24

GZipOutputStream: Remember to finish() what you start!

Had an interesting experience the other day. I was creating a stream of compressed data using GZipOutputStream and ended up with lots of missing data.

It turns out that data will (may?) not be properly written to the output stream if you neglect to call finish() when you're done pumping data in. Strangely enough, neither flush() nor even close() are sufficient to accomplish this; it's either finish() or you risk having corrupt, incomplete data in your output.