[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] [Fwd: jar files and libglpk.so]
From: |
Heinrich Schuchardt |
Subject: |
Re: [Help-glpk] [Fwd: jar files and libglpk.so] |
Date: |
Sat, 14 Jun 2014 23:21:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 |
Dear Mr. Campos,
the error you see indicates that some old version of the GLPK for Java
or the GLPK library was loaded which does not contain method new_glp_cpxcp.
Could it be that at some time you installed an elder version of GLPK
e.g. by calling
sudo apt-get install libglpk-java
and removed the *.so files you compiled from /usr/local/lib?
If you want to load
libglpk-java.so
from a nonstandard location you have to indicate this location by
setting java.library.path or LD_LIBRARY_PATH.
See http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
If you want to load
libglpk.so from a nonstandard location you either have to set
LD_LIBRARY_PATH or use
./configure --enable-libpath
and afterwards use java.library.path to indicate the path to search.
You can find a screenshot at
http://en.wikibooks.org/wiki/GLPK/Java#Usage_with_Eclipse
which shows how to set java.library.path in an Eclipse project (project
property "Native library location").
Best regards
Heinrich Schuchardt
On 14.06.2014 20:18, João Campos wrote:
Dear Mr. Heinrich Schuchardt:
It is true that I have the .so files and the .jar files.
Right now I have a little program written in Java in eclipse so I can read a
model in a file. I have added the .jar file to my BuildPath in eclipse.
I also have copied the .so files to my workspace. This may seem a bit naive,
but it worked when I had to include other programs in my eclipse projects.
The error I get is:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.gnu.glpk.GLPKJNI.new_glp_cpxcp()J at org.gnu.glpk.GLPKJNI.new_glp_cpxcp(Native Method)
at org.gnu.glpk.glp_cpxcp.<init>(glp_cpxcp.java:48) at Main.main(Main.java:9)
I am using this operating system: Ubuntu 12.04.4 LTS.
The installation instructions followed are contained in the following
link:http://glpk-java.sourceforge.net/gettingStarted.html
More precisely:
GLPKDownload the current version of GLPK source withwget
ftp://ftp.gnu.org/gnu/glpk/glpk-4.54.tar.gzUnzip the archive with:tar -xzf
glpk-4.54.tar.gz
cd glpk-4.54Configure with:./configureMake and install with:make
make check
sudo make install
sudo ldconfig
and
GLPK for JavaDownload GLPK for Java from
https://sourceforge.net/projects/glpk-java/files/.Unzip the archive with:tar
-xzf glpk-java-1.0.36.tar.gz
cd glpk-java-1.0.36Configure with:./configureMake and install with:make
make check
sudo make install
sudo ldconfig
Thank you for your help.
Yours sincerely,
João Campos