java -Djava.library.path 中的多个目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30176215/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 16:36:19  来源:igfitidea点击:

Multiple directories in -Djava.library.path

javajvmjava-native-interfacejvm-argumentsjava.library.path

提问by Umberto Raimondi

How can I point to two differents java.library.pathin eclipse project - run configurations? I need these two libraries:

如何指向java.library.patheclipse 项目中的两个不同点- 运行配置?我需要这两个库:

-Djava.library.path=/opt/hdf-java/build/bin
-Djava.library.path=/opt/opencv-2.4.10/build/lib

Regards.

问候。

回答by Umberto Raimondi

On Linux, use colon :as separator (as you will do with the classpath option) as in:

在 Linux 上,使用冒号:作为分隔符(就像使用 classpath 选项一样),如下所示:

-Djava.library.path=/opt/hdf-java/build/bin:/opt/opencv-2.4.10/build/lib

回答by isapir

Use the platform's File.pathSeparator, i.e. ;on Windows and :on *nix, to separate directories, just like you would separate the directories in the classpath.

使用平台的File.pathSeparator,即;在 Windows 和:*nix 上分隔目录,就像在类路径中分隔目录一样。

e.g. Windows:

例如Windows

-Djava.library.path=C:/dir1;C:/dir2

or *nix:

*nix

-Djava.library.path=/dir1:/dir2