1

I have a java console app that needs to open up the browser. I used the code like below.

java.awt.Desktop.getDesktop().browse(uri) 

It does open up the browser with URL but prints out below on the console. How can I disable that? I don't think i want that to be printed when my customer uses the app.

If this is an output from Firefox executable, how can I redirect this out put so that user don't see that?

Firefox hook launcher starting up
run-parts: executing /usr/lib/ppt/firefox-hooks/00ppt-firefox-certs
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
Notice: Trust flag u is set automatically if the private key is present.
run-parts: executing /usr/lib/ppt/firefox-hooks/10firefox-disable-bad-prefs
Firefox hook launcher finished
paras
  • 21
  • 2
  • Related SO question from 2017 with no answer but possibly helpful comments: [Suppress stdout / stderr from Desktop.browse(uri);](https://stackoverflow.com/questions/42983528/suppress-stdout-stderr-from-desktop-browseuri). Just noticed the edit section of that question states - *"This seems to be due to the fact that the managed OS that I am running has a wrapper around firefox, whose shebang is defined as `#!/bin/bash -x` causing the script to execute verbosely."* – Jonny Henly Aug 19 '19 at 20:57

0 Answers0