[Rxtx] RXTX rebundled (fwd)
Trent Jarvi
tjarvi at qbang.org
Thu Apr 19 05:13:34 MDT 2012
Would there be interest in seeing these change in RXTX?
---------- Forwarded message ----------
Date: Thu, 19 Apr 2012 11:21:00 +0200
From: Alexander Christian <alex at root1.de>
To: tjarvi at qbang.org
Subject: RXTX rebundled
Hi Trent,
Thanks for the greate rxtx Java Library. I already used it several times in
different projects.
But now I wanted to use it in a Maven3 project. I searched the Maven Central
Repo and found it. Great. BUT: The artifact does not contain the native
libraries and there was no suggestion on how to handle this issue "the maven
way". I also found the setup-explanation in the wiki a bit away from "state of
the art" (changing the JRE installation isn't practivle for stand-alone desktop
applications etc...). So I rebundled your rxtx library and extened it a little
bit:
1) The artifact consists of one single JAR containing all required files,
including the native libs
2) I added a kind of "automatic library loader", which replaces the
"System.loadLibraray()" calls in rxtx source code. This loader detects the OS +
ARCH and extracts the correct native lib from JAR to the temp folder of the OS.
Finally the extracted native lib is loaded from temp folder. If JVM terminates,
the temp native lib files are removed.
3) The rest of rxtx source is unchanged.
So, one can now use maven to get RXTX library + no worry about "how to load the
lative lib" and "where to get the native libs when using maven" ...
Of course there's one "downside" of this improvement: The rxtx JAR is a bit
bigger due to the fact that it contains all native libs for all OS + ARCH. But
today size (currently 554k) often doesn't matter.
Maybe you're interested in these changes?!
You can find the source here:
http://svn.root1.de/svn/rxtx-rebundled/tags/2.1-7r2/
best regards,
Alex
More information about the Rxtx
mailing list