Exception in thread "main" java.lang.UnsatisfiedLinkError: no lpsolve55j in java.library.path -
in .bashrc written:
pythonpath="${pythonpath}:$home/local/lib/python2.7/site-packages/" export pythonpath ld_library_path="$home/local/lib/" export ld_library_path classpath="/home/stud/qe09kyvu/local/lib/liblpsolve55j.so" export classpath when try run command:
java -cp .:../lib/lpsolve55j.jar -djava.library.path=../liblpsolve55j.so demo i following error:
exception in thread "main" java.lang.unsatisfiedlinkerror: no lpsolve55j in java.library.path but don't understand error, because in .. there liblpsolve55j.so
to run lpsolver, need 2 things.
platform/os specific binary listed below , should keep them in corresponding library path or export corresponding environment specific property
- libsolve55.dll windows - either should copy these files system32 or set path ld_library_path environment variable
- libsolve55.so linux - should copy these files /usr/local/lib or set path ld_library_path environment variable
- libsolve55.dylib mac - should copy these files /usr/local/lib or set path ld_library_path environment variable dyld_fallback_library_path
language specific wrapper invoking lp_solver method present in above binary file. java need liblpsolve55j.jnilib , lpsolve5j.o file. either location of these should added java.library.path or add them above platform-specific environment variable.
in case, seems set in step 2, missing step 1. step 1, instead of environment variable, can include path in java.library.path alreay passing. gave example below.
$ java -cp ./demo.jar:../lib/lpsolve55j.jar -djava.library.path=/users/santhoshgandhe/mac_lpsolver/lp_solve_5.5/lpsolve55/bin/osx64:/users/santhoshgandhe/mac_lpsolver/lp_solve_5.5_java/lib/mac demo
Comments
Post a Comment