1

The application runs without problems in Eclipse. It has a SQLite database which is referenced with relative path as follows:

connection = DriverManager.getConnection("jdbc:sqlite"+absPath+File.pathSeparator+"PatientRegistry.sqlite");

Where absPath is File absPath = new File("");.

Notice that the SQLite driver is added to the project in Eclipse (build path, add JAR in the libraries). Again when I run in Eclipse it works fine.

Now I exported the JAR and it does not work anymore. In the command line I get this error: java.lang.ClassNotFoundException: org.sqlite.JDBC. When I unzip the JAR both the database and the driver are in it.

7
  • Is it some sort of all-in-one über-jar where the included jars are busted out into their own classes? Commented Dec 4, 2015 at 19:04
  • well the driver for sqlite is a jar and yes it is in the jar that i'm trying to run. Commented Dec 4, 2015 at 19:05
  • The jar is in the jar, or the jar's classes are in the jar? Commented Dec 4, 2015 at 19:12
  • In other words, stackoverflow.com/q/9573868/438992 or stackoverflow.com/q/12341993/438992. Commented Dec 4, 2015 at 19:13
  • the jar (the sqlite driver) is in the jar (my exported project) in a lib folder Commented Dec 4, 2015 at 19:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.