简体   繁体   English

如何在Eclipse中生成没有引用库的JAR文件?

[英]How to generate a JAR file without referenced libraries in Eclipse?

I'm doing File > Export > Runnable JAR file . 我正在执行文件>导出>可运行的JAR文件 And the available library handling options are "Extract required libraries...", "Package required libraries...", "Copy required libraries...". 可用的库处理选项为“提取所需的库...”,“打包所需的库...”,“复制所需的库...”。 I have a huge list of referenced libraries, and all of this takes forever. 我有大量的引用库,而所有这些都将永远存在。 I already selected the option "Copy libraries into sub-folder next to generated jar", and do not want to re-copy them every time a re-generate the jar file. 我已经选择了“将库复制到生成的jar旁边的子文件夹中”选项,并且不想在每次重新生成jar文件时都重新复制它们。 How to do this? 这个怎么做? Thanks. 谢谢。

I don't think there is any direct support for this but you could probably work around this limitation. 我认为对此没有任何直接支持,但是您可以解决此限制。 You could remove all the libraries from eclipse so it will be invisible to eclipse. 您可以从Eclipse中删除所有库,因此对Eclipse不可见。 That way you don't have to export the libraries, because to eclipse they are not there. 这样,您就不必导出库了,因为要使它们不存在而使它们黯然失色。 It will export with errors though because eclipse will be confused. 尽管由于eclipse会造成混淆,但它将导出错误。 Also, if you want to use this method you need to reimport the libraries after you exported your project. 另外,如果要使用此方法,则需要在导出项目后重新导入库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM