[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rxtx
Subject:    Re: [Rxtx] Native libraries in platform specific jars
From:       Brian Schlining <bschlining () gmail ! com>
Date:       2010-03-15 20:26:56
Message-ID: ae0cc0d81003151326v3f73625ar7584ab4afd631002 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


>
>
> > Native libraries can only be loaded from JARs when you are using Java
> > Webstart (see
> >
> http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html#resourcesand
> > http://rxtx.qbang.org/wiki/index.php/WebStart). When doing so the native
> > library must be located at the root of the jar.
>
> Not only JWS - e.g. Eclipse SWT does the same thing (by extracting .dll/so
> files to temp folder before loading them).


JNA can also extract and use native libraries (same as SWT), I don't know if
this extraction technique works in JWS though.

To see how JNA does it go to
https://jna.dev.java.net/source/browse/jna/trunk/jnalib/src/com/sun/jna/Native.java?view=markup
and
look at the loadNativeLibrary and loadNativeLibraryFromJar methods.

Cheers
-- B
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining@gmail.com

[Attachment #5 (text/html)]

<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br> &gt; Native \
libraries can only be loaded from JARs when you are using Java<br> &gt; Webstart \
(see<br> &gt; <a href="http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html#resourcesand" \
target="_blank">http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html#resourcesand</a><br>
 &gt; <a href="http://rxtx.qbang.org/wiki/index.php/WebStart" \
target="_blank">http://rxtx.qbang.org/wiki/index.php/WebStart</a>). When doing so the \
native<br> &gt; library must be located at the root of the jar.<br>
<br>
</div>Not only JWS - e.g. Eclipse SWT does the same thing (by extracting .dll/so \
files to temp folder before loading them).</blockquote><div><br></div><div>JNA can \
also extract and use native libraries (same as SWT), I don&#39;t know if this \
extraction technique works in JWS though.</div> <div><br></div><div>To see how JNA \
does it go to  <a href="https://jna.dev.java.net/source/browse/jna/trunk/jnalib/src/co \
m/sun/jna/Native.java?view=markup">https://jna.dev.java.net/source/browse/jna/trunk/jnalib/src/com/sun/jna/Native.java?view=markup</a> \
and look at the  <span class="Apple-style-span" style="font-family: &#39;Andale \
Mono&#39;, Courier, monospace; color: rgb(51, 51, 51); line-height: 16px; \
white-space: pre; ">loadNativeLibrary <span class="Apple-style-span" style="color: \
rgb(0, 0, 0); font-family: arial; line-height: normal; white-space: normal; \
">and</span> loadNativeLibraryFromJar <span class="Apple-style-span" style="color: \
rgb(0, 0, 0); font-family: arial; line-height: normal; white-space: normal; \
">methods.</span></span></div> <div><span class="Apple-style-span" \
style="font-family: &#39;Andale Mono&#39;, Courier, monospace; color: rgb(51, 51, \
51); line-height: 16px; white-space: pre; "><span class="Apple-style-span" \
style="color: rgb(0, 0, 0); font-family: arial; line-height: normal; white-space: \
normal; "><br> </span></span></div><div><span class="Apple-style-span" \
style="font-family: &#39;Andale Mono&#39;, Courier, monospace; color: rgb(51, 51, \
51); line-height: 16px; white-space: pre; "><span class="Apple-style-span" \
style="color: rgb(0, 0, 0); font-family: arial; line-height: normal; white-space: \
normal; ">Cheers</span></span></div> </div>-- B<br>~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ \
~ ~ ~ ~ ~ ~ <br>Brian Schlining<br><a \
href="mailto:bschlining@gmail.com">bschlining@gmail.com</a><br>



_______________________________________________
Rxtx mailing list
Rxtx@qbang.org
http://mailman.qbang.org/mailman/listinfo/rxtx


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic