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

List:       rxtx
Subject:    Re: [Rxtx] FW: Loading of native library
From:       Brian Schlining <bschlining () gmail ! com>
Date:       2009-07-15 3:21:59
Message-ID: ae0cc0d80907142021l42de5384v7e89201cbafd4dfe () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> You could also do a System.setProperty(..) to set the java.library.path
> system property before you reference the RXTX code.


That won't actually work. At least not on all platforms. If I remember the
JVM spec right, that technically shouldn't work on any platform.


> |
>> |  > java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
>> | thrown while loading gnu.io.RXTXCommDriver
>> |
>> | I know we could pass "-Djava.library.path=." to the virtual machine so
>> | RXTX can find its library, but we'd rather load it programmatically (as
>> | this piece of code is a plugin that may or may not be installed with the
>> | base application).
>
>
On the Sun JVM, there is a runtime hack you can use to load native libraries
at runtime that aren't on the operating systems library path or listed on
the java.library.path. An example of the hack can be found at
http://mbarix4j.googlecode.com/svn/trunk/src/main/java/org/mbari/util/LibPathHacker.java

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

[Attachment #5 (text/html)]

<div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex;">You could also do a \
System.setProperty(..) to set the java.library.path system property before you \
reference the RXTX code.</blockquote> <div><br></div><div>That won&#39;t actually \
work. At least not on all platforms. If I remember the JVM spec right, that \
technically shouldn&#39;t work on any platform.</div><div>  </div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"> <blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">|<br> |   &gt; \
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path<br> | thrown while \
loading gnu.io.RXTXCommDriver<br> |<br>
> I know we could pass &quot;-Djava.library.path=.&quot; to the virtual machine \
> so<br>
> RXTX can find its library, but we&#39;d rather load it programmatically (as<br>
> this piece of code is a plugin that may or may not be installed with the<br>
> base application).</blockquote></blockquote><div><br></div><div>On the Sun JVM, \
> there is a runtime hack you can use to load native libraries at runtime that \
> aren&#39;t on the operating systems library path or listed on the \
> java.library.path. An example of the hack can be found at  <a \
> href="http://mbarix4j.googlecode.com/svn/trunk/src/main/java/org/mbari/util/LibPathH \
> acker.java">http://mbarix4j.googlecode.com/svn/trunk/src/main/java/org/mbari/util/LibPathHacker.java</a></div>
> 
<div>  </div></div>-- <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