Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!news.osn.de!diablo2.news.osn.de!news.belwue.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Philipp Kraus Newsgroups: comp.lang.java.programmer Subject: loading dll within a jar Date: Mon, 3 Oct 2011 22:47:22 +0200 Organization: 1&1 Internet AG Lines: 19 Message-ID: NNTP-Posting-Host: p3ee29bc7.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 1317674842 2188 62.226.155.199 (3 Oct 2011 20:47:22 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Mon, 3 Oct 2011 20:47:22 +0000 (UTC) User-Agent: Unison/2.1.5 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8505 Hello, is there a way to load a DLL library that is stored within a Jar? At the time I'm using the -Djava.library.path flag but I would like to store the DLL within the Jar and added the path dynamically. I've found some information about this eg extract the DLL to the temp directory and set the -D option on the main-method. Can I set also the library path to the java command like the classpath argument? My java classes use the a static { System.loadLibrary("dllname"); } to load the library, so can I add on the static attribute a call for loading the dll within the jar? Thanks Phil