How can I include external jar on my Netbeans project

后端 未结 12 2759
挽巷
挽巷 2020-11-27 06:25

When I run \"clean and build\" the .jar file that is being created only runs if the lib folder is at the same folder of the .jar file.

12条回答
  •  抹茶落季
    2020-11-27 07:18

    If you are going to distribute your app to another pc

    You just zip .jar along with lib folder.

    If want to run your app from any place in your pc

    Take in cosideration Maven way of doing this - create local repository eg. C:\libs where your libraries would exist and .jar could accesses them later from any place in your pc.

    Or you could just use Maven. There is a discussion on distributing application with all dependencies (libraries): Java: How do I build standalone distributions of Maven-based projects?.

提交回复
热议问题