Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #8656
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news-peer.in.tum.de!news.belwue.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail |
|---|---|
| From | Philipp Kraus <philipp.kraus@flashpixx.de> |
| Newsgroups | comp.lang.java.programmer |
| Subject | System.load / System.loadLibrary |
| Date | Sun, 9 Oct 2011 12:45:04 +0200 |
| Organization | 1&1 Internet AG |
| Lines | 48 |
| Message-ID | <j6rtvg$g6t$1@online.de> (permalink) |
| NNTP-Posting-Host | p3ee29748.dip0.t-ipconnect.de |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | online.de 1318157104 16605 62.226.151.72 (9 Oct 2011 10:45:04 GMT) |
| X-Complaints-To | abuse@einsundeins.com |
| NNTP-Posting-Date | Sun, 9 Oct 2011 10:45:04 +0000 (UTC) |
| User-Agent | Unison/2.1.5 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8656 |
Show key headers only | View raw
Hello,
I use System.loadLibrary to load a shared DLL. This DLL requires other
depended DLLs. If all (under OSX DYLD_LIBRARY_PATH) is configurated the
System.loadLibrary loads my DLL and everything works fine. I have
tested the same code with the DYLD-Option is not set, so my Java code
should be break.
I would like to set the Path to the library like this code:
String[] l_libraries = { "boost_system", "mylib" };
try {
for( String i : l_libraries )
System.loadLibrary(i);
} catch (UnsatisfiedLinkError e_link1) {
File l_temp = new File(
System.getProperty("java.io.tmpdir") + "mytemp" );
if (!l_temp.isDirectory())
l_temp.mkdirs();
for( String i : l_libraries ) {
String l_lib = l_temp +
System.getProperty("file.separator") + System.mapLibraryName(i);
if
(System.getProperty("os.name").toLowerCase().indexOf("mac") >= 0)
l_lib = l_lib.substring(0,
l_lib.indexOf(".jnilib")) + ".dylib";
System.load(l_lib);
}
}
My target is: try to load the library and the depended from the default
system pathes, if not exists than load the libs from
a temporary path. mylib needs a depend boost library, so I load the
boost lib first, but I get the error:
Library not loaded: libboost_system.dylib Referenced from:
/mytemp/mylib.dylib Reason: image not found
Does anybody know a tip to load all libraries first, so the Java VM can
work with them from a "fixed" path?
Thanks
Phil
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar
System.load / System.loadLibrary Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-10-09 12:45 +0200
Re: System.load / System.loadLibrary Roedy Green <see_website@mindprod.com.invalid> - 2011-10-09 03:52 -0700
Re: System.load / System.loadLibrary Roedy Green <see_website@mindprod.com.invalid> - 2011-10-09 04:22 -0700
Re: System.load / System.loadLibrary Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-10-09 14:09 +0200
Re: System.load / System.loadLibrary Roedy Green <see_website@mindprod.com.invalid> - 2011-10-09 07:54 -0700
Re: System.load / System.loadLibrary markspace <-@.> - 2011-10-09 09:32 -0700
Re: System.load / System.loadLibrary Philipp Kraus <philipp.kraus@flashpixx.de> - 2011-10-09 18:41 +0200
Re: System.load / System.loadLibrary markspace <-@.> - 2011-10-09 10:31 -0700
Re: System.load / System.loadLibrary "John B. Matthews" <nospam@nospam.invalid> - 2011-10-09 22:26 -0400
csiph-web