Clear Filters
Clear Filters

Set Java class parameter

3 views (last 30 days)
Ritesh Shah
Ritesh Shah on 11 Nov 2015
Commented: Ritesh Shah on 16 Nov 2015
I am trying to use a custom java driver( UcanAccess ) to connect to a Access database. I was able to add the java file and its dependencies to my java path. However, the driver requires me to set a java parameter with the path to the driver. Without setting the path I get the following error message:The UCANACCESS_HOME system variable isn't defined: it should be: -DUCANACCESS_HOME=<your path to the UCanAccess-3.x.x-bin folder>. Does anyone know how to set this java parameter ?

Accepted Answer

Shruti Sapre
Shruti Sapre on 16 Nov 2015
Hi Ritesh,
Are you trying to connect to Access using MATLAB, and are trying to set the system variable in MATLAB?
In general, you could pass the required argument as a VM argument to a Java application:
If connecting through MATLAB, you could try placing the -D directive in the java.opts file based on the example below:
Hope this helps!
-Shruti
  1 Comment
Ritesh Shah
Ritesh Shah on 16 Nov 2015
Thanks Shruti !!! That is exactly what I needed.

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!