Closed jbkyang-nvi closed 1 year ago
Context: We have a packaged *.jar file from javacpp-presets that we are trying to run in a container that has some access restrictions. Question:
- Can a user can specify the Loader's cached path (right now in
`~/.javacpp/cache/
) at runtime?
Yes, users can set the "org.bytedeco.javacpp.cachedir" system property for that purpose: https://github.com/bytedeco/javacpp/wiki/System-Properties However, it automatically falls back on the tmp directory, so there's probably no need to worry about that.
- Currently our built
linkpath
is specified in our build container (different from runtime container). Is there a way to change thelinkpath
that the bindings are looking for at runtime? Where is the generatedlinkpath
specified? Would the recommended solution be to specify multiple possiblelinkpaths
of where the library could be during creation of the *.jar?
Users can always set the usual "java.library.path" system property for JNI: https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getProperties-- At build time, it can also be done as part of the build system. For Maven, for example: https://github.com/bytedeco/javacpp-presets/blob/1.5.8/opencv/pom.xml#L93-L98
If there are only a few possible locations for the libraries, or defaults at least, we can hard code multiple paths in the @Platform
annotation, sure, that's fine too.
Please let me know if this doesn't answer your questions though! Thanks
Hi @saudet sorry I was on vacation. Thanks for answering!
Context: We have a packaged *.jar file from javacpp-presets that we are trying to run in a container that has some access restrictions. Question:
`~/.javacpp/cache/
) at runtime?linkpath
is specified in our build container (different from runtime container). Is there a way to change thelinkpath
that the bindings are looking for at runtime? Where is the generatedlinkpath
specified? Would the recommended solution be to specify multiple possiblelinkpaths
of where the library could be during creation of the *.jar?