I downloaded the daal update 2 and installed it on a windows system. I have been able to run the java examples using the .bat files. But, when I set up an Eclipse program, I am running into problems. The daal.jar is recognized (build goes through) but when I run an example, I get the following error:
Here I am running the simple LibraryVersionInfoExample
Exception in thread "main" java.lang.UnsatisfiedLinkError: no JavaAPI in java.library.path
Is this a recognized problem or is it just my setup.
Was able to resolve the issue: I had not included the dll libraries in the System PATH. I added the following to the path variable;
and it fixed the issue.
This error is because Intel DAAL Java library requires a native library (JavaAPI.dll on Windows, libJavaAPI.so on Linux). And your Eclipse project does not find this native library. There're multiple ways to fix this. But the cleanest and simplest way is this:
- Create a new project in your IDE. Copy a DAAL example file into this project. In your case, you copy LibraryVersionInfoExample.java into your project.
- Configure Build Path. Click on the "Source" tab under "Java Build Path". Expand the src branch. Locate "Native library location" and double-click to edit it. Give it this value (using Windows as an example but Linux should be similar):
C:/Program Files (x86)/Intel_sw_development_tools/compilers_and_libraries_2016/windows/redist/intel64_win/daal
- On the same window, click the "Libraries" tab. Click "Ad JARs" to add "daal.jar", which is found in the DAAL installation location on your computer.
- Click "OK" to save the configuration.
- Then select "Run Configurations" from the "Project" menu. Click the "Environment" tab.
- Add a new environment variable "Path". Give it this value:
C:\Program Files (x86)\Intel_sw_development_tools\compilers_and_libraries_2016.0.049\windows\redist\intel64_win\daal;C:\Program Files (x86)\Intel_sw_development_tools\compilers_and_libraries_2016.0.049\windows\redist\intel64_win\compiler;C:\Program Files (x86)\Intel_sw_development_tools\compilers_and_libraries_2016.0.049\windows\redist\intel64_win\tbb\vc_mt
- Click "Apply" and close the window.
- Now your code should run correctly inside Eclipse.
We recognize that the current DAAL examples are not configured with IDE users in mind. It's not easy for a new user to use DAAL with a Java IDE. Hopefully, we will improve this in future releases.
Thank you Zhang. That was helpful.
However for the Linux based Eclipse, I needed to do the following to make it work;
1. Add the daal.jar to the build path (step 3 from Zhang)
2. Then select "Run Configurations" from the "Project" menu. Click the "Environment" tab. Add a new environment variable "LD_LIBRARY_PATH". Give it this value: (similar to step 5 and 6 from Zhang) Note "LD_LIBRARY_PATH" and not "Path"
There was no need to add the Native Library Location under "Source" tab (step 2 from Zhang).