Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
196 views
in Technique[技术] by (71.8m points)

java - UCanAccess driver not found when converted to JAR file

I made a project named clinic which has 3 jframes

  1. login
  2. clinic management
  3. 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 contains

  • the 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

  1. Create a zip file that contains the application JAR file (YourStuff.jar) and the accompanying lib folder that contains [the additional jar files that your application requires].

  2. Send the file to the people who will use the application. Instruct them to unpack the zip file, making sure that the main application jar file and the lib folder are in the same folder. The users of your application should be able to run it by double-clicking the JAR file.

For example, when I unpack the zip file for my test application I have

[C:\__tmp]
    README.TXT
    UCanAccessDemo.jar
    [lib]
        commons-lang-2.6.jar
        commons-logging-1.1.1.jar
        hsqldb.jar
        jackcess-2.0.6.jar
        ucanaccess-2.0.9.2.jar

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.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...