Q:

How do I get rid of the errormessage when I use Sublime text 2 in terminal

When I open a Java source-code with sublime text the error message keep rolling in the terminal Window: 
(sublime_text:19271): GLib-CRITICAL **: Source ID 2897 was not found when attempting to remove it.

Any solutions? It works but is really annoying.

A:

Not a solution really, but a workaround. Just redirect standard error to /dev/null so you don't see it:
sublime foo.jar 2>/dev/null

To make this simpler, you can convert that to a function. Add these lines to your ~/.bashrc:
sublime(){
    sublime "$@" 2>/dev/null
}

That, however, will suppress all errors, not only that one. To suppress that one alone, use this instead:
sublime(){
    sublime "$@" 2>&1 | grep -v 'GLib-CRITICAL **: Source ID 2897 was not found when attempting to remove it.'
}

