Generating a Jar in Eclipse including external library

谁说我不能喝 提交于 2019-11-28 01:27:23

Eclipse has its own Jar export wizard for generate a runnable jar packed with required library or with the required library in a folder aside the jar.

Going in File ---> Export then choose Java - Runnable Jar

You can then choose how pack the jar and how handling libraries :

You can also save the ant script for later modification or use ...

You actually should use Ant or Maven for your task, I see no other option. Ant is already packed with eclipse, you only need to install a JDK, not only a JRE.

Ant is very easy to learn and you can find billions of examples in the internet. With ant you can do exactly what you want.

Maven is the more up-to-date way to build and package jars and do much more other stuff. Maven also is a good choice for you.

dmcnelis

I'll second a vote for Maven. Eclipse has a decent maven integration (m2eclipse). Then check out this answer for building the jar effectively using Maven2

Building a runnable jar with Maven 2

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