I want to put jar into my generated jar file . i want to include a new dependency (external.jar) for my executable jar file.the external.jar do not contain a main method.
Asked
Active
Viewed 104 times
-2
-
Possible duplicate of [Java creating .jar file](http://stackoverflow.com/questions/4597866/java-creating-jar-file) – Dev2017 Mar 09 '17 at 16:34
-
my external.jar don't have a main method – Garsov Mar 09 '17 at 16:45
2 Answers
0
Use jar cf jar-file input-file(s)
. I recommend reading http://www.skylit.com/javamethods/faqs/createjar.html , https://docs.oracle.com/javase/tutorial/deployment/jar/build.html and Java creating .jar file
0
If you are using mavan, you can add the next to pom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>fully.qualified.MainClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>

victorpacheco3107
- 822
- 3
- 10
- 32
-
i want to add a dependency without maven , without access to the source code . – Garsov Mar 09 '17 at 16:36