I made a project named clinic which has 3 jframes
- login
- clinic management
- generate patient ID
It is connected to an Access database (.mdb).
I converted it to JAR file but it gives me error that it is not getting connected to the UCanAccess driver.
I even tried SQLite manager but had the same problem. I am using netbeans 8. I just directly selected clean and build option to make the jar file. Hope this helps.
Do you have export lib files within .jar file? There are some dependency classes which are required to connect to database which also need to be included with .jar file, or you can copy all required dependency to folder named as
lib
in same folder where your .jar file exist.Unlike Eclipse, NetBeans does not offer a standard way to Export a Java project to a single runnable JAR file that contains all of the project's dependencies. Instead, when you Build a Java project in NetBeans it creates a
\dist
folder that containsthe JAR file for your own Java code, plus
a
\lib
subfolder containing the JAR files for the dependencies.When you distribute your Java project to other users, Packaging and Deploying Desktop Java Applications says that you need to
For example, when I unpack the zip file for my test application I have
A quick web search revealed at least one mechanism that claims to allow NetBeans to create a single monolithic JAR file that includes dependencies ...
PackagingADistributableJavaApp
... but I have not tried it myself. (I just get Eclipse to do it.)