Programming from 51 years old (currently 52) Note: Add jar with VScode Class.forName java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Drive

When I java with VScode, I sometimes get hooked. This time, I wanted to use jdbc of mysql to handle DB (mysql).

java.long.ClassNotFoundException: com.mysql.cj.jdbc.Driver

I couldn't stop the error. A full day to resolve (tears)

In VScode, the [java Dependency Viewer] is used to install the external jar file, so when installing [Project Manager for java] with the VScode extension (for jdk8, the instool version is 0.9.0 or older. Please use it).

Then, the following memorandum!

vscode_dependenciew.jpg Select the java file in ① Select ② Explorer menu [...] ③ If jdk8-> [java Dependencies] For jdk11-> [java Project] If you check Like ④ [Java PROJECTS] \ (jdk11) or [Java DEPANDENCIES] \ (jdk8) Is displayed, open those directories Display [Referenced Libraries] Click [+] in ⑤!

Then vscode_dependenciex.jpg Since the folder opens so that you can specify the external file you want to use Specify the desired file and finish!

How is it! It took time!

Recommended Posts

Programming from 51 years old (currently 52) Note: Add jar with VScode Class.forName java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Drive
Programming from 51 years old (currently 52) memorandum VScode javadoc
Programming from 51 years old (currently 52) Note Path and File
Programming from 51 years old Note Service --reference
Programming from 51 years old Note Thread summary
(Currently 52) programming from 51 years old Note 3 lines Move focus to android button
Programming from 51 years old Note: Checking Android network connection
Programming from 51 years old Note AsyncTask --reference [copying sutras]
(Currently 52) programming from 51 years old Note FileOutputStream android.content.Context.openFileOutput (java.lang.String, int)'on a null object reference
Programming from 51 years old Note: Show multiple views in android dialog / with or without xml
Programming from 51 years old Note: Background execution restrictions OverView [copying sutras]
Programming from 51 years old memorandum android Timer
Programming memorandum from 51 years old (currently 52) java.awt javax.swing in VScode // Java 11 or more recent is required to run
Programming from 51 years old [copying sutras] Intent IntentFilter-reference
Programming from 51 years old Android memo Activity Manager memo
Programming memorandum from 51 years old Notification IntentService Service code memorandum / summary
Programming from 51 years old Make FusedLocationProviderClient resident in Foreground Service
Programming from 51 years old Note Android Asynchronous communication callback Processing after AsyncTask ends Further generalization / standardization