0

When building the project from command line using mvn clean install everything builds without any issues.

When running some tests that use precompiled C libraries from IntelliJ, tests fail with java.lang.UnsatisfiedLinkError

I may be completely off here, but does IntelliJ not see the .so file? Is so, how can it be added please?

James Raitsev
  • 92,517
  • 154
  • 335
  • 470

1 Answers1

1

Shared library fails to load with UnsatisfiedLinkError if:

  1. it's not in the working directory configured in the test run configuration.

  2. it's not in PATH environment (on Mac Terminal and GUI apps have different environment, see this answer). Run IDEA from the Terminal open -a /Applications/IntelliJ\ IDEA\ 12.app/ to make environment the same.

  3. it's not in the location specified using -Djava.library.path VM option.

  4. .so depends on some other library that is not found for any of the 1-3 reasons (or the dependency of that dependency is not found, etc).

Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904