Domanda

I have installed the IBM ILOG v12.2 for Linux on a server whose OS is Red Hat Linux. I programmed the Java interfaces, and when I run it on the server, the following errors show:

Native code library failed to load: ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
Exception in thread "main" java.lang.ExceptionInInitializerError
    at ilog.concert.cppimpl.concert_wrap.setDebugWrappers(concert_wrap.java:34)
    at ilog.opl.IloOplFactory.setDebugMode(IloOplFactory.java:152)
    at MainNetworkVirtulization.main(MainNetworkVirtulization.java:185)
Caused by: java.lang.RuntimeException: Native code library failed to load: ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
    at ilog.concert.IloJNILoader.loadJNI(IloJNILoader.java:79)
    at ilog.concert.cppimpl.concert_wrapJNI.<clinit>(concert_wrapJNI.java:15)
    ... 3 more
Java Result: 1

BY the way, this Java interfaces code runs fine on my other Windows laptop. Does anyone know how to correct the above errors? Thank you!

È stato utile?

Soluzione

You need to add LD_LIBRARY_PATH to your environment variable so that the ILOG libraries can be loaded.

For example, in my .profile, I have the following (using cplex, not concert, but you get the idea.):

export LD_LIBRARY_PATH=/opt/cplex125/cplex/bin/x86-64_sles10_4.1

you can also run with -Djava.library.path <path> and pass that to your VM, but I find the above to be much less of a hassle as you don't have to remember that argument for each invocation.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top