sandervs / javahidapi

Automatically exported from code.google.com/p/javahidapi
Other
0 stars 0 forks source link

Touble building ControlTower example in Eclipse #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
I imported all the source files into a new project and added the jar library 
files hidapi.jar, JavaDrone-1.1.jar, log4j-1.2.16.jar,  and 
libhdiapi-jni-64.jnilib to the build path. 

What is the expected output? What do you see instead?
I would expect I could simply build the project but I can't. I get these errors 
and can't figure out why.

Description Resource    Path    Location    Type
Archive for required library: 
'/Users/username/code/eclipse/Test/lib/mac/libhidapi-jni-64.jnilib' in project 
'Test' cannot be read or is not a valid ZIP file    Test        Build path  Build Path 
Problem

Description Resource    Path    Location    Type
The project cannot be built until build path errors are 
resolved    Test        Unknown Java Problem

What version of the product are you using? On what operating system?
Eclipse SDK
Version: 3.7.2
Mac OSX 10.6.8

Original issue reported on code.google.com by rjdura...@gmail.com on 6 Apr 2012 at 3:09

GoogleCodeExporter commented 8 years ago
This looks like the problem I had when using this library. 

To solve my problem, I did as follows:
1) remove the .jnilib file from the project build-path 
2) make sure that the hidapi.jar file is included in the project build-path
3) go: Configure project build path and select the 'libraries' tab. 
4) click the pull-down arrow beside the hidapi.jar include
5) doubleclick the 'Native library location', and select the location of the 
.jnilib file

Explanation: The libhidapi-jni-64.jnilib is not an actual Java library, it is 
the native interface for the library. The actual library to include is the 
hidapi.jar. By itself though the hidapi.jar doesn't do anything, it needs a 
native library to work with. And so we tell it to use the 
libhidapi-jni-64.jnilib as the native library.

I think .jnilib is specific to Mac OSX, if you wanted to do this on windows you 
would select the .dll file instead. 

Hope that helps!

Original comment by scott.g....@gmail.com on 25 May 2012 at 12:15

GoogleCodeExporter commented 8 years ago
Please use new build of JavaDrone.
If you are still having problems open a bug report in JavaDrone project.

Original comment by kroko...@gmail.com on 1 Aug 2012 at 1:40