java.sql.SQLException: No suitable driver found for jdbc:sqlite

后端 未结 1 803
天命终不由人
天命终不由人 2020-12-21 23:26

My Java program (one of my very first) seems to be hanging at the following line of standard code:

    Class.forName(\"org.sqlite.JDBC\");

             


        
相关标签:
1条回答
  • 2020-12-22 00:19
    sudo java -cp ./jsoup-1.7.3.jar:./sqlite-jdbc-3.7.2.jar:.
    

    any idea how to proceed? thanks a million

    Yes. Two major problems I see. One, unless you have a very good reason, don't run your program with sudo. It could cause you major pain later if you do.

    Second, your classpath doesn't look correct. jar files are located on it. The first part should be the path to search and the second the jars to search for.

    java -cp ".:jsoup-1.7.3.jar:sqlite-jdbc-3.7.2.jar" ...
    

    Finally, I assume you downloaded from sqlite here and jsoup here and have the jar files in your current directory and if it still isn't working you should check those files are correct.

    $ sha1sum sqlite-jdbc-3.7.2.jar 
    cea9f7f8e6bcb580d953a8651fb8391640de0f85  sqlite-jdbc-3.7.2.jar
    $ sha1sum jsoup-1.7.3.jar 
    ab1f22cadc2f8b514e55ba368f5128056fe304da  jsoup-1.7.3.jar
    
    0 讨论(0)
提交回复
热议问题