1

how to link native library .so file in netbeans

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

3
  • you can find the library path using this System.setProperty("java.library.path"); and can add file with this location Commented Jan 21, 2013 at 11:20
  • @BuntyMadan System.getProperty() not System.setProperty() Commented Jan 21, 2013 at 11:53
  • @LoganDam first confirm about System.getProperty("java.library.path"); Commented Jan 21, 2013 at 12:15

3 Answers 3

2

Add the directory where the .so is stored to the java.library.path or add the library to a directory already in the path or use the full path name of the library. The last option may be the most robust if you have a way of determining what it is.

Sign up to request clarification or add additional context in comments.

Comments

1

Set library path -Djava.library.path=library\path where your *.so file resides.

1 Comment

I had add the following in VM Option :-Djava.library.path="C:\Program Files\Java\jdk1.6.0_13\bin*.so" as well as the lib in the mentioned directory but it still throws an exception
0

UnsatisfiedLinkError is shown because no library with the specified name has been found in your java.library.path

Before loading your library:

System.setProperty("java.library.path", "path_to_your_library");

1 Comment

it still throws an exception

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.