Sebastiaan-Alvarez-Rodriguez commented on pull request #7030:
URL: https://github.com/apache/arrow/pull/7030#issuecomment-700644439


   Hi there @zhztheplayer,
   thanks for the response!
   
   On building the project:
   > Have you checked if arrow_dataset_jni.so was successfully installed within 
the jar arrow-dataset-XXX.jar? If not, specifying arrow.cpp.build.dir may help.
   
   I checked the file `/java/dataset/target/arrow-dataset-1.0.0-SNAPSHOT.jar`, 
and it indeed does not contain the `.so` file you mentioned. When I compile 
using 
   `mvn clean install -P arrow-jni -am 
-Darrow.cpp.build.dir=../../cpp/build/release -Dmaven.test.skip=true`
   the `.so` file is added. I took these extra parameters from 
`java/README.md`. I don't know how I could have missed that.
   
   > I did a little try and it appears that System.loadLibrary requires for 
property java.library.path to be set to include library locations. If we change 
to use this way, do users have to do this every time before getting started?
   
   Good point! My IDE handles runtime parameters for me, including 
`-Djava.library.path=...`.
   Although there is no consensus on the internet, it would seem that not 
specifying the `java.library.path` will make use of an operating 
system-dependent default value.
   E.g. for most Linux distros, the default value would be the LD_LIBRARY_PATH 
environment variable.
   What you could do, is making sure your `.so` files are always installed in 
standard locations for each operating system, and then rely on the default 
value for `java.library.path`. However, it is unsafe to rely on the default 
value for `java.library.path` while there is no (official) documentation to 
back it (as far as I could find).
   
   With this in mind, I think it would indeed be best to include the `.so` in 
the jar and use your original strategy for loading it.
   
   Thank you for your time and have a nice day!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to