How to include a .jar dependency into the ANT target that generate my final .jar file of my application?

前端 未结 1 1042
南笙
南笙 2021-01-27 22:21

I am pretty new in Ant and I have the following problem creating the build.xml file that handle the creation of a .jar file of the following si

相关标签:
1条回答
  • 2021-01-27 23:01

    Basically what you're asking is how do I package one jar file into another, you should not do this (for many reasons, one being it is against almost all licenses).

    When you run you compile AND when you run, you need the jdbc jar on your classpath:

    Run with:

    java -cp ./lib/ojdbc6.jar -jar Main.jar
    

    or something like

    java -cp Main.jar:./lib/ojdbc6.jar Main
    

    Your run target in your build.xml also needs to reference the classpath.

    0 讨论(0)
提交回复
热议问题