java - How to combine mysql Jar with the application jar file in IntelliJ IDEA 14 -


i used idea14 make dbms application in java swing gui. try run jar file, i'm having class not found exception mysql jdbc connector. i'm stuck , have no clue on how resolve issue...

enter image description here

you trying put mysql.jar dependency in same jar , reference manifest's class-path, , not possible default java class loader.

see details official java documentation @ https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

one way of fixing move mysql.jar out of smsreminder.jar artifact, on same level smsremider.jar. change class-path entry become class-path: mysql.jar (note there no full path here c:/ideaprojects/..). when building artifact, idea place both jars in 1 , same folder. running java -jar smsreminder.jar should work.

another way use custom or opensource class loader, described here: classpath including jar within jar


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -