简体   繁体   English

Eclipse中的Java库路径-一次将dll库添加到多个jar中?

[英]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.

相关问题 常春藤或ivyDE可以在Eclipse中自动将相关的jar添加到JAVA构建路径库中吗? - Can ivy or ivyDE add related jars into JAVA build path library automatically in Eclipse? 在OSGi / Eclipse jar中打包具有依赖性的Java库 - packaging Java library with dependencies in OSGi/Eclipse jars 使用 maven 将 dll 添加到 java.library.path - Add dll to java.library.path using maven 蚀使用变量创建用户库以指定罐子路径 - eclipse creating user library using variable to specify jars path Java Eclipse中的DLL加载库错误 - DLL Load Library Error in Java Eclipse 如何在eclipse导出到战争时将所有外部jar添加到库中 - How to add all external jars to library on eclipse export to war Eclipse Java:插件库中缺少jar,是推荐替代方案还是解决方案? - Eclipse Java: missing jars from plugin library, recommend alternatives or solution? Eclipse Helios:Java EE观点:如何像参考库一样在一个引擎盖下添加jar以构建路径 - Eclipse Helios: Java EE Perspective: How to have jars added to build path under one hood like referenced library DLL的JAVA库路径INPUT / OUTPUT - JAVA library path INPUT/OUTPUT for DLL 如何使用 Eclipse 启动将本机库添加到“java.library.path”(而不是覆盖它) - How to add native library to “java.library.path” with Eclipse launch (instead of overriding it)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM