[英]Java Library Path in Eclipse - Add dll library to multiple jars at once?
I have used the accepted answer provided to the question "How to set the java.library.path from Eclipse?" 我已经使用了问题“如何从Eclipse设置java.library.path?”提供的可接受的答案。 for setting the library path for a specific jar. 用于设置特定jar的库路径。
In my case, I have about 10 third party jars and each jar depends on the same set of dlls, but I need to do this process for each jar. 就我而言,我大约有10个第三方jar,每个jar依赖于同一组dll,但是我需要为每个jar执行此过程。 I can do this manually, but is there any way to do this for more than one jar at a time? 我可以手动执行此操作,但是有什么方法可以一次完成一个以上的罐子吗?
In your case, manually editing the project's .classpath
file might gain you a bit of efficiency. 就您而言,手动编辑项目的.classpath
文件可能会提高您的效率。 When I set the location of a JAR's native library, the following entry is added to my .classpath
file: 当我设置JAR本机库的位置时,以下条目将添加到我的.classpath
文件中:
<classpathentry exported="true" kind="lib" path="path/to/library.jar" sourcepath="/path/to/src">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="path/to/native/library.dll"/>
</attributes>
</classpathentry>
You might manually set up the first JAR (via the Eclipse UI), close Eclipse and copy/paste the generated classpath entries in .classpath
with the appropriate modifications, and then restart Eclipse. 您可以手动设置第一个JAR(通过Eclipse UI),关闭Eclipse并使用适当的修改将生成的类路径条目复制/粘贴到.classpath
,然后重新启动Eclipse。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.