Deployment of jar file and including outside libraries

▼魔方 西西 提交于 2019-12-11 14:50:06

问题


For the past several weeks I've been working with Java and I know that this question may be dumb...

I created a console application which is using the MySQL Connector to update records in a database, the problem is that when I deploy it to a jar file and run it I get that the MySQL Connector is missing. I used JDeveloper for this deployment and from the jar export settings I marked that this library needs to be exported too. I am not sure what could be the issue and any input will be welcomed.

Thank you in advance.


回答1:


You have to add lib: my-sql-connnector.jar in your META-INF.MF in your main jar file.




回答2:


Use maven for dependencies. You will build .jar with all dependencies.



来源:https://stackoverflow.com/questions/20567754/deployment-of-jar-file-and-including-outside-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!