[Rxtx] Package RXTX libraries in an applet?
Brian Schlining
bschlining at gmail.com
Tue Nov 16 10:27:42 MST 2010
>
>
> Is it possible to create a jar package containing the native libraries and
> RXTXcomm.jar?
>
> And load it using JNLP and System.load/System.loadLibrary?
>
> Or can the “no manual install” be achieved some other way?
>
Yes, zip that native library (rxtxSerial.dll) up int a file and change the
extension from 'zip' to 'jar' (Not actually sure that you need to change the
extension but I do and it works). Your JNLP will then look something like:
<?xml version="1.0" encoding="utf-8"?>
<jnlp codebase="http://foobar.com/webstart" href="mycoolappwithrxtx.jnlp">
<information>
<title>Foo</title>
<vendor>Bar</vendor>
<homepage href="index.html"/>
<description>Foo Bar</description>
<icon href="icon.jpg"/>
<icon kind="splash" href="splishy-splashy.jpg"/>
<offline-allowed/>
<shortcut>
<desktop/>
<menu submenu="VARS"/>
</shortcut>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" initial-heap-size="64m" max-heap-size="128m"/>
<jar href="myfoobar.jar
<jar href="RXTXcomm.jar" />
</resources>
<resources os="Mac OS X">
<nativelib href="rxtx-native-macosx.jar" />
</resources>
<resources os="Linux">
<nativelib href="rxtx-native-linux.jar"/>
</resources>
<resources os="Windows">
<!-- RXTX Native libraries -->
<nativelib href="rxtx-native-windows.jar"/>
</resources>
<application-desc main-class="my.cool.App"/>
</jnlp>
Important: You need the <security><all-permissions/></security> tags. Notice
the <resources> tags that target each platform. You can only include windows
if you want, make sure the name of the jar matches the name of the one you
put your rxtxSerial.dll in.
Cheers
--
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20101116/7cc6cfec/attachment-0640.htm>
More information about the Rxtx
mailing list