UCANACCESS_HOME系统变量未设置 [英] UCANACCESS_HOME system variable not set

查看:252
本文介绍了UCANACCESS_HOME系统变量未设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用UCanAccess将Java应用程序连接到Access数据库,但是当我运行Java应用程序时,出现错误

I'm trying to use UCanAccess to connect a Java application to an Access database but when I run my Java app I get the error that

未定义UCANACCESS_HOME系统变量...

UCANACCESS_HOME system variable isn't defined...

我已将六个jar文件添加到NetBeans的项目库中.我还已经将ucanaccess-3.0.3.jar文件存储到的目录的路径添加到Windows 10中的PATH系统变量中.我还尝试创建一个没有运气的新系统变量UCANACCESS_HOME.

I have added the six jar files to the project library in NetBeans. I've also added the path to the directory where the ucanaccess-3.0.3.jar file is stored to the PATH system variable in Windows 10. I also tried creating a new system variable UCANACCESS_HOME with no luck.

任何能帮助我指出正确方向的帮助将不胜感激.

Any help that could point me in the right direction would be greatly appreciated.

推荐答案

您可以

(1)确保CLASSPATH在UcanAccess发行版的"lib"目录中包含ucanaccess-x.x.x.jar 四(4)个jar文件

(1) ensure that your CLASSPATH includes the ucanaccess-x.x.x.jar and the four (4) jar files in the "lib" directory of the UCanAccess distribution,

(2)确保您的CLASSPATH包含"loader"文件夹中的 just ucanload.jar,并设置Java

(2) ensure that your CLASSPATH includes just the ucanload.jar from the "loader" folder, and set a Java system property named UCANACCESS_HOME when you launch the Java virtual machine, e.g., by using the -Dproperty=value switch

-DUCANACCESS_HOME=<directory into which you unpacked the UCanAccess binary distribution>

也就是说,UCANACCESS_HOME在解压缩UCanAccess发行zip文件后必须指向直接包含ucanaccess-x.x.x.jar的目录.例如:

That is, UCANACCESS_HOME must point to the directory that directly contains ucanaccess-x.x.x.jar after decompressing the UCanAccess distribution zip file. For example:

-DUCANACCESS_HOME=/home/gord/Downloads/JDBC/UCanAccess-3.0.1-bin


这两个配置是互斥的. 第一个是普遍采用的.


The two configurations are mutually exclusive. The first one is the generally adopted one.

第二个方法利用JDBC驱动程序的类加载机制,以使用其他类加载器加载依赖项.如果应用程序已经使用了HSQLDB,commons-lang,commons-logging和/或Jackcess的特定版本,则可以使用ucanload.jar来避免应用程序最终使用的这些jar的不同版本之间的冲突.换句话说,使用这种方法,您可以确保您的应用程序继续使用其以前使用的(其他)版本的HSQLDB,commons-lang,commons-logging和/或Jackcess,而UCanAccess使用其发行版中的版本.

The second one leverages the JDBC driver classloading mechanism in order to load dependencies with a different classloader. If an application already uses specific versions of HSQLDB, commons-lang, commons-logging, and/or Jackcess then ucanload.jar can be used to avoid conflicts between different versions of those jars eventually used by your application. In other words, using this approach you can be sure that your application continues to use the (other) versions of HSQLDB, commons-lang, commons-logging, and/or Jackcess that it used before, while UCanAccess uses the ones in its distribution.

这篇关于UCANACCESS_HOME系统变量未设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆