构建JAR,包括其所有的依赖 [英] Building JAR that includes all its dependencies

查看:136
本文介绍了构建JAR,包括其所有的依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个非常基本的问题,但我怕我不知道很多关于Java和我找不到任何地方的答案。

This is probably a really fundamental question, but I'm afraid I don't know much about Java and I couldn't find the answer anywhere.

我试图建立依赖于TFS SDK的Ant库。我跟着的指南设立一个项目,但是当我出口它作为一个JAR文件,并尝试运行任务使用ANT我收到以下错误:

I'm attempting to build an Ant library which depends on the TFS SDK. I followed the guide to setting up a project, but when I export it as a JAR and try to run a task using ANT I get the following error:

java.lang.NoClassDefFoundError: /com/microsoft/tfs/core/util/TFSUser

我知道我可以把TFS SDK JAR在我的ANT lib文件夹中,但如果可能的话,我想我的JAR,包括它和图书馆,而不必这样做只是工作。

I realise I could put the TFS SDK JAR in my ANT lib folder, but if possible I'd like my JAR to include it and the library just work without having to do so.

<一个href=\"http://stackoverflow.com/questions/528007/eclipse-java-export-jar-include-referenced-libraries-without-fatjar\">This回答似乎说这可能包括使用Eclipse(我使用3.7.2)运行所需的所有资源,但它没有详细说明如何真正做到这一点。什么是Eclipse这样做的选项?

This answer seems to say it's possible to include all the resources needed to run using Eclipse (I'm using 3.7.2) but it doesn't detail how to actually do it. What is the option in Eclipse to do so?

推荐答案

选择提取需要的库文件在生成JAR为你做的出口。

Select "Extract required libraries into generated JAR" as you do the export.

为你做的导出选择提取需要的库文件在生成JAR。

Select "Extract required libraries into generated JAR" as you do the export.

这篇关于构建JAR,包括其所有的依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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