-2

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.

Garsov
  • 31
  • 6

2 Answers2

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

Community
  • 1
  • 1
Dev2017
  • 857
  • 9
  • 31
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