如何从 Eclipse 设置 java.library.path [英] How to set the java.library.path from Eclipse

查看:83
本文介绍了如何从 Eclipse 设置 java.library.path的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为整个 Eclipse 项目设置 java.library.path?我正在使用依赖于操作系统特定文件的 Java 库,需要找到 .dll/ .so/ .jnilib.但是应用程序总是退出并显示一条错误消息,指出在库路径中找不到这些文件.

How can I set the java.library.path for a whole Eclipse Project? I'm using a Java library that relies on OS specific files and need to find a .dll/ .so/ .jnilib. But the Application always exits with an error message that those files are not found on the library path.

我想将整个项目配置为使用库路径.我尝试将路径作为 VM 参数添加到 eclipse 中的某些运行配置中,但这不起作用.

I would like to configure this whole project to use the library path. I tried to add the path as a VM argument to some run configurations in eclipse but that didn't work.

推荐答案

不要弄乱库路径!Eclipse 自己构建它!

Don't mess with the library path! Eclipse builds it itself!

相反,进入项目的库设置,对于每个需要本机库的 jar/etc,在Libraries 选项卡中展开它.在那里的树视图中,每个库都有源/javadoc 和本机库位置的项目.

Instead, go into the library settings for your projects and, for each jar/etc that requires a native library, expand it in the Libraries tab. In the tree view there, each library has items for source/javadoc and native library locations.

具体:选择Project,右键-> Properties/Java Build Path/Libraries 标签,选择一个.jar,展开它,选择Native library location,点击Edit,就会出现文件夹选择器对话框)

Specifically: select Project, right click -> Properties / Java Build Path / Libraries tab, select a .jar, expand it, select Native library location, click Edit, folder chooser dialog will appear)

在命令行上弄乱库路径应该是你最后的努力,因为你可能会破坏 eclipse 已经正确设置的东西.

Messing with the library path on the command line should be your last ditch effort, because you might break something that is already properly set by eclipse.

这篇关于如何从 Eclipse 设置 java.library.path的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆