Java Developers

Java Developers

261,403 members
  • Join

    When you join a group, other members will be able to see your profile and message you. The group logo will be visible on your profile unless you change that setting.

  • Information and settings

Have something to say? Join LinkedIn for free to participate in the conversation. When you join, you can comment and post your own discussions.


Can anyone tell me how to merge two jar file into one . for example :- my application jar file is in some other folder and external jar file (mysql-jconnector) is in another folder thank you

Software Engineer at Hexaware Technologies Ltd.

  • Comment (5)
  • May 9, 2012
  • Close viewer


  • Brian R.


    Brian R.

    Senior Software Engineer at Basho Technologies


  • Puneet B.


    Puneet B.

    Senior Associate Technology at Nagarro

    lol... awsmeee

  • atul T.


    atul T.

    Software Programmer at Arosys Technologies (P) Ltd

    Anshul ,mysql-jconnector jar file use for mysql Db connectivity.

  • Anu

    Anu P.

    Experienced Java Tech Lead, (virtual teams),Software Architect,Aware of current technologies

    Try the maven plugin shade

  • Alan H.


    Alan H.

    Senior Software Engineer at Western Area Power Administration

    First of all, I agree with Brian, you could have Googled your question and had an answer in way less time.

    Second, why do you want to merge Jar files? This only make it less clear which code is yours and which code belongs to someone else. You can package your code in a single folder (make a copy of the JDBC connector Jar for this), then zip the whole package for distribution.

    Normally, best practices are to create a folder structure with a lib file for your supporting jars, and a bin folder for your executable code.

    If you absolutely must put the connector classes in your jar, you should look at the link Brian provided. Simplest is to use the jar command to unjar the connector and put those classes in your project's folders somewhere.

    Finally, if you're using an IDE there is probably an option when you create the Jar to package your dependent jars' classes into your jar. I know Eclipse does it and I suspect that NetBeans will have the same functionality. Once again, Google is your best friend.

Your group posting status

Your posts across groups are being moderated temporarily because one of your recent contributions was marked as spam or flagged for not being relevant. Learn more.