[Rxtx] Package RXTX libraries in an applet?

Damgaard, Thomas Thomas.Damgaard at polycom.com
Wed Nov 17 06:49:15 MST 2010


Hi

Works perfectly! Thank you very much!!

Best regards,
Thomas Fogh Damgaard
Polycom (Denmark) ApS

From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Brian Schlining
Sent: 16. november 2010 18:28
To: rxtx at qbang.org
Subject: Re: [Rxtx] Package RXTX libraries in an applet?



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<mailto:bschlining at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20101117/83caebf0/attachment-0632.htm>


More information about the Rxtx mailing list