How export Java jar from Eclipse with dependencies on other jars?

跟風遠走 提交于 2019-11-29 07:40:32

It may help someone

1.Select Export from Project Properties

2.Select Runnable Jar option

3.Finish the JAR creation (Here, you have the option to package all dependencies into the generated jar.)

I would seriously consider using Maven or a similar tool like Gradle to manage the dependencies of the different projects for you; it is very much not a good idea to cram together different dependencies into one jar just so you don't have to include them in other projects again; that is a recipe for dependency hell, library clashes and maybe even licensing conflicts.

The existence of that class-path line in your main application jar's manifest would be an indication that what you expect has in fact not happened by the way; the dependencies are externally referenced so I'm going to make a guess that the classes are not inside the application jar.

Just to answer this question: In the end, we decided to include the jars of the dependencies directly in the project and avoid havign jars in jars. Using Mavin is also being considered, but would require some substantial chagnes to the way our projects are setup.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!