help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Problems using glpk from Java


From: Alberto Marin
Subject: Re: [Help-glpk] Problems using glpk from Java
Date: Thu, 6 Oct 2011 20:46:05 +0200


Thanks a lot, it worked! I was passing the library path as a parameter to the jvm but that was not enough.

Now it all works well when I run my program from ant but It crashes if I run it from the Netbeans platform. Does anyone know why this error might come up?

java.lang.UnsatisfiedLinkError: org.gnu.glpk.GLPKJNI.glp_create_prob()J
    at org.gnu.glpk.GLPKJNI.glp_create_prob(Native Method)
    at org.gnu.glpk.GLPK.glp_create_prob(GLPK.java:47)

Thanks in advance,
Alberto



On Wed, Oct 5, 2011 at 5:20 PM, xypron <address@hidden> wrote:

Hello Aleberto,

libglpk.so must be in the library search path.

E.g.
LD_LIBRARY_PATH=mypath_to_libglpk:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

Best regards

Xypron


Alberto Marin wrote:
>
> Hello everybody,
>
> I am using GLPK from java and I am having a few problems. I am trying to
> use
> the version that comes by default in Ubuntu but the same problems arise
> with
> other versions.
>
> I have the jar file, the glpk_java library and libglpk.so library in a
> directory where all my dependencies are. The classloader finds the jar
> file
> and libglpk_java, but it fails to find the libglpk.so that is sitting in
> the
> same directory.
>
> the error:
> *Exception in thread "main" java.lang.UnsatisfiedLinkError:
> /home/amarin/NetBeansProjects/latest/CaMBio/lib64/Linux/libglpk_java.so.0.31.0:
> libglpk.so.0: cannot open shared object file: No such file or directory
>     at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
>     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1675)
>     at java.lang.Runtime.loadLibrary0(Runtime.java:840)
>     at java.lang.System.loadLibrary(System.java:1047)
>     at de.mpg.biochem.cambio.tests.testglpk.<clinit>(testglpk.java:26)
> Could not find the main class: de.mpg.biochem.cambio.tests.testglpk.
> Program
> will exit.
> Java Result: 1*
>
> This file can only be found if I place it in /usr/lib and nowhere else but
> I
> need it in my dependencies dir. (This all becomes even worse if I call
> glpk
> from the Netbeans platform...)
>
>  Is it the way the library is packed? I am doing something wrong?
>
> Any help would be appreciated
>
> Thanks,
> Alberto
>
>  *
> *
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk
>
>

--
View this message in context: http://old.nabble.com/Problems-using-glpk-from-Java-tp32592429p32595468.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.


_______________________________________________
Help-glpk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-glpk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]