Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Fredrik Jonson Newsgroups: comp.lang.java.programmer Subject: Re: is it possible to package a Java application in one jar that includes everything? Date: 20 Feb 2012 20:48:08 GMT Lines: 26 Message-ID: References: X-Trace: individual.net ZjYsQJOrHYP8R6y5ZmzoaQ/qruJzVp9QJQ07N37H1dlKVi3wo= Cancel-Lock: sha1:p1I++xDj4xJK0garft/JUUhBpIA= User-Agent: slrn/pre1.0.0-18 (Linux) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12199 In Nasser M. Abbasi wrote: > Is it possible to package my Java application, including all and any > other Java code, that I might have downloaded from the web and used, into > one jar file. You can. If you use maven for build management you can use the shade plugin to build such "uberjars". I believe there are similar utilities for ant. https://maven.apache.org/plugins/maven-shade-plugin/ > I've done something like this before, and I remember using Makefiles and > the jar. Yes, jar files are just a zip container for class files so that is possible. You can put whatever files (resources) you like in the jar, not only class files. If you have more than one project I'd strongly recommend avoiding Makefiles nowdays and using maven, ant, ivy or some other special purpose build management tool for java. https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html -- Fredrik Jonson