0

I made a Java application using netbeans and used sqlite as database Everything works in netbeans but when i export the program to jar file and run it on another machine, an exception appeared when i try to connect sqlite database

The exception is about this line: Class.forName("org.sqlite.JDBC"); and the exception is: java.lang.ClassNotFoundException: org.sqlite.JDBC

I looked at all related threads in stackoverflow and no pure answer about this.

Thanks in advanced,

3 Answers3

0

Just add the sqlite driver jar to your class path. You application can't find the class org.sqlite.JDBC so it means a jar is missing in your class path.

TheEwook
  • 11,037
  • 6
  • 36
  • 55
0

Either include the sqlite jdbc driver in the jar file or make sure that you have it in your classpath. Add it as -classpath sqlite driver

Seid.M
  • 185
  • 7
0

Problem Solved

I had import the sqlite jar file for both compile time and run time. From netbeans -> project properties -> Libraries.

and Then i moved the exported jar file from dist folder in addition to lib folder to another machine .. and worked smoothly .. Thanks Guys up