I\'ve heard that catching java.lang.Error
is considered bad practice.
I\'m currently loading a .dll that is not guaranteed to be on the PATH, and would like to
You should only catch Errors in very specific cases. Only catch and error if you have explored all other possibilities. I completely agree with everything Lukas Knuth said. But i have one small addition. In case you to catch any kind of error, make sure that you catch errors from as narrow a scope as you can. Also, if possible, make sure that the methods you catch errors on are declared as final. The reason is that catching Errors can usually lead to some very shaky programs. Consider that you catch an error on a method that is later extended to call other methods, all these underlying methods would now also have errors caught (unintentionally) by the overlying catch.
If you need to catch an Error, do it in a narrow, controlled fasion.