How to create a jar with external libraries included in Eclipse?

后端 未结 8 1642
北恋
北恋 2020-11-22 10:46

I am done with the project which connects to database (MySQL). Now I want to export the project as jar. But I don\'t know how to include its external dependencies? Is there

8条回答
  •  天涯浪人
    2020-11-22 11:14

    While exporting your source into a jar, make sure you select runnable jar option from the options. Then select if you want to package all the dependency jars or just include them directly in the jar file. It depends on the project that you are working on.

    You then run the jar directly by java -jar example.jar.

提交回复
热议问题