I want to package my files into jar,but these are dependent on Apache HttpClient jars. So is there any way to package all into single jar ??
Asked
Active
Viewed 909 times
0
-
Actually I don't know about how to use maven.Is there any way without maven? If not then what I will have to do it in maven way? – Amar Agrawal Oct 06 '14 at 06:21
-
1[here](http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) is hwo you can do it using maven – A4L Oct 06 '14 at 06:23
-
2Using eclipse you could right click on your project > Export > Java > Runnable JAR file > next > select launch configuration and choose package required libraries into generated jar > Finish. – A4L Oct 06 '14 at 06:28
2 Answers
0
You can put the dependency jars into your project's jar. Here is some info.

Community
- 1
- 1

Sachin Verma
- 3,712
- 10
- 41
- 74
0
You can use a build tool like Maven to manage project dependencies easily. If you are using eclipse all you need to do is to install maven plugin and than you can create maven projects(or you can also convert your existing one).
After creating maven project you can manage dependencies by making entry into the pom.xml file. You can do something like this :
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
</dependency>

Atul Sharma
- 718
- 4
- 11