Maricruzz
Maricruzz

Reputation: 405

Error using native code

I have two projects in eclipse. Project1 and Project2. Project1 uses native code which is included with:

static {
    System.loadLibrary("thelibraryname");
}

I added Project1 to the build-path of project 2. Project2 calls methods from a class in Project1, which uses the native methods. However, I am getting an error when running Project2:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no thelibraryname in java.library.path

The directory struture of my eclipse project looks like this:

Project1
    Android 1.6
    Android Dependancies
    src/
    bin/
    libs/
        armeabi/
            libthelibraryname.so
        armeabi-v7a/
            libthelibraryname.so
        x86/
            libthelibraryname.so
    <some-other-dirs-and-files>
Project2
    src/
        Testing.java
    Junit
    JRE System Library

I found that the error has something to do with the native code. Probably I need to provide a reference to the native code somewhere but I could not find how. Note that eclipse does not indicate any errors at compile time, only at runtime.

Any ideas what I can do to fix this? :)

Edit:

Upvotes: 0

Views: 470

Answers (1)

Alex G
Alex G

Reputation: 41

here is an instruction use UTF-8 encoding and it will work http://stijndewitt.wordpress.com/2010/05/05/unicode-utf-8-in-eclipse-java/

Upvotes: 1

Related Questions