0

I deployed my java application onto a new windows machine. I have installed java on the new windows machine to run the deployed java application. When i run the application, it opens alright but it gives this error " com.jdbc.mysql.Driver not found". I know this has got to do with the database.

How do i solve this issue please? Is there something else i have to install again for the application to work?

  • Could you provide more details about your application? Packaging? Any Web/Application Server where you are deploying it? Do you have code base for it? Can you build it? – Sergei Sirik Aug 22 '17 at 21:10
  • 1
    It means the JAR with the MySQL JDBC driver class is not in the CLASSPATH. How did you package the application? Is it an executable JAR? If yes, I'd advise you to learn how to create a fat executable JAR using Maven's Shade plugin. You should not under any circumstances add a CLASSPATH environment variable. There are better solutions available. – duffymo Aug 22 '17 at 21:11
  • @duffymo https://netbeans.org/kb/docs/java/javase-deploy.html this is the documentation i followed. What i did was, i cleaned and built the application to get an executable jar. I zipped the jar together with the lib from the `dist` folder in the project. Is the right way? –  Aug 22 '17 at 21:16
  • I would be grateful if i had a link to how to use the Maven's Shade plugin –  Aug 22 '17 at 21:16
  • It would be easy if you were using Maven. Are you? https://maven.apache.org/plugins/maven-shade-plugin/examples/executable-jar.html – duffymo Aug 22 '17 at 21:33
  • This guy claims to be able to do it with NetBeans: http://www.jitendrazaa.com/blog/java/generating-executable-jar-file-with-all-dependencies-and-libraries-in-single-jar-using-netbeans-and-eclipse/ – duffymo Aug 22 '17 at 21:35

0 Answers0