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
loadLibrary calls findLibrary() which would be helpful but it's protected, your best bet is to write your own class extending ClassLoader. Class loader has a protected method called findLibrary() which will return the path to a library or null if it doesn't exists. That way you can just check for null instead of catching errors. I'm not sure if this is actually "better" but it will remove your need for try catch;