Merge pull request from robertbrignull:java_init_logging

PiperOrigin-RevId: 257039697
This commit is contained in:
TensorFlower Gardener 2019-07-08 17:02:23 -07:00
commit 413d93bc0a

View File

@ -63,7 +63,19 @@ public final class TensorFlow {
/** Load the TensorFlow runtime C library. */
static void init() {
NativeLibrary.load();
try {
NativeLibrary.load();
} catch (Exception e) {
/*
* This code is called during static initialization of this and of other classes.
* If this fails then a NoClassDefFoundError is thrown however this does not
* include a cause. Printing the exception manually here ensures that the
* necessary information to fix the problem is available.
*/
System.err.println("Failed to load TensorFlow native library");
e.printStackTrace();
throw e;
}
}
static {