Closed
Description
Changed in: Bazel 5.0.0
The directories of native libraries (cc_binary
, cc_library
) in the data
attribute of Java targets (java_library
, java_test
, java_binary
, java_import
) are not collected and added as -Djava.library.path
attribute to the JVM. This may cause System.load
call to fail finding such a library.
Design document: https://docs.google.com/document/d/10isTEK5W9iCPp4BIyGBrLY5iti3Waaam6EeGVSjq3r8/edit#bookmark=id.xq791hgfxn1o
Migration
Solution is to move dependency to such a library from the data
to runtime_deps
(or to deps
in case of java_import
). Alternative is to replace System.load
call with System.loadLibrary
, which can be given path to the library.