Connect Java to SQLite

I downloaded sqlitejdbc-v056.jar from

http://www.zentus.com/sqlitejdbc/

to C:\teston a 32-bit version of Windows XP. And loaded the SQLite3 database into a folder C:\test. Then I launched java -cp .:sqlitejdbc-v056.jar. Then I tested after compilation Test.java, but he gave me this error message:

Exception in thread "main" java.lang.NoClassDefFoundError: Test

+3
source share
1 answer

It cannot find your compiled Test.class file. You need to indicate its location in your class path. Is it supposed to be in the current directory? it seems that you intend to do this because your path includes ".".

, , ':' Windows, . Linux, , ; Windows? "-cp.; Sqlitejdbc-v056.jar". , .

+3

Source: https://habr.com/ru/post/1729654/


All Articles