Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carify docs about where to put what #819

Closed
jjpe opened this issue May 26, 2017 · 5 comments
Closed

Carify docs about where to put what #819

jjpe opened this issue May 26, 2017 · 5 comments

Comments

@jjpe
Copy link

jjpe commented May 26, 2017

NOTE: Only file GitHub issues for bugs and feature requests.

Before you post a new issue please check the
JNA users' group and the
existing issues for duplicates. Please use the user group also for general
questions.

Provide complete information about the problem

  1. Version of JNA and related jars -
    most recent
  2. Version and vendor of the java virtual machine -
    any
  3. Operating system -
    any
  4. System architecture (CPU type, bitness of the JVM) -
    any
  5. Complete description of the problem -
    Despite reading the docs It is unclear to me what needs to go where. Specifically I'm still unable to figure out what the layout of a JAR file needs to look like in order to use this feature. Everything I try fails. What os.name values are valid for Mac OS X, for example? What must go into the pom file of the Java library using JNA and incorporating the native library? What must go into the POM file of the code that consumes that java library? It's all super unclear to me, so increased clarity in the docs would certainly help. For more contextual info, you can look at this SO issue that I have needed to open.
  6. Steps to reproduce-
    N/A
@matthiasblaesing
Copy link
Member

Have a look at the java in NativeLibrary (class level) and see com.sun.jna.Platform#getNativeLibraryResourcePrefix and com.sun.jna.Platform#getCanonicalArchitecture for the possible combinations.

@matthiasblaesing
Copy link
Member

As an advise your problem is currently not the native library:

Caused by: java.lang.ClassNotFoundException: cereal.UClient

Your packaging is broken. And for Mac OS X the right prefix is darwin (this asumes a fat binary is build).

@jjpe
Copy link
Author

jjpe commented May 26, 2017

It's odd that my packaging is broken since I just mvn install snapshots of the library, and then for the application (the java lib consumer) I force maven to load the installed lib by using this pom.xml dependency:

      <dependency>
            <groupId>com.github.jjpe</groupId>
            <artifactId>libcereal-java</artifactId>
            <version>0.9.0-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>/Users/j/.m2/repository/libcereal/libcereal-java/0.9.0-SNAPSHOT/libcereal-java-0.9.0-SNAPSHOT.jar</systemPath>
        </dependency>

Given that it's broken, any thoughts on what can be done about it? Or for that matter what exactly could be wrong?

@matthiasblaesing
Copy link
Member

If you have a failing system and show a dependency with system scope you now where to search. Hint: remove the system path and change the scope to compile.

@jjpe
Copy link
Author

jjpe commented May 26, 2017

Ah I finally see what happened. Thank you for this answer, it has been very helpful to me.

@jjpe jjpe closed this as completed May 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants