Problem scenario
In Linux you are trying to run a Java program that connects to a MySQL database. The program compiles, but it does not run. You get this error: “java.lang.ClassNotFoundException: com.mysql.jdbc.Driver” What should you do?
Solution
1. Set the CLASSPATH variable in two steps. First set it to where the .class file is for the Java file you are running.
…