davisusanibar commented on PR #34312:
URL: https://github.com/apache/arrow/pull/34312#issuecomment-1496551195

   > My apologies if I am misunderstanding something here -- I am thinking that 
the issue is that there is a DLL file named `x86_64\arrow_dataset_jni.dll` and 
loading this fails with a `FileNotFoundException` because the actual DLL is 
named `x86_64/arrow_dataset_jni.dll`.
   > 
   > If this is right, would changing the name of the generated DLL file and 
using `File.separator` not work? I am a bit unclear on what you mean by "there 
are no another way that maintain this code inside java classes" -- do you 
please mind explaining? Do you mean to say that even if we make the CMake 
change, we would still need to make changes in the application because loading 
the JAR would fail?
   
   1. CMake did the work without problems: Create folder `x86_64` and put the 
native library inside that `arrow_dataset_jni.dll`
   2. Next step is Java time, Java at runtime need to localize and load that 
native library specified by the filename argument.
   3. `File.separator` (Windows) is translated/converted to `\` (that generate 
problems), and File.separator (Unix's) is translated/converted to `/` (working 
without problems)
   4. BUT Java independently of the OS mention 
[getResource](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#getResource-java.lang.String-:~:text=The%20name%20of%20a%20resource%20is%20a%20%27/%27%2Dseparated%20path%20name%20that%20identifies%20the%20resource.):
  `The name of a resource is a '/'-separated path name that identifies the 
resource.` 
   
   For that reason in case is needed to identified a resource (as the DLL) is 
needed to use `/` instead of `File.separator` independently of the OS.
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to