Search code examples
modbus

How to edit build properties of a Java Library


There seem to be some similar questions, but nothing quite specific enough, I hope this is OK.

I am wondering how to edit the build properties of the Jamod MODBUS library so as to use the RxTx API instead of the deprecated javax.comm. The Library page says this is supported:

You will need an implementation of the Java Communications API extension (javax.comm) installed to be able to run serial modbus applications. Note that there is also support for building with the gnu.io prefix (RXTX), via the boolean build property build.serial.gnu (true will cause the build process to replace the javax.comm prefix with gnu.io in the sources used for builds).

More info here: http://jamod.sourceforge.net/development/project_build.html

I am unsure how to access this file, or the technique for doing so. Do I need to create it or edit and existing one? I have look for build.xml in the project, but no luck, and have googled many times. Any help very much appreciated.


Solution

  • Just open the proyect source (you can download it from rxtx) with an IDE (for example Netbeans) then replace every appearance of javax.comm by gnu.io, from rxtx, add RXTXcomm.jar library to project, and if you are using windows then copy and rxtxSerial.dll for example to C:\windows\system32.

    It will work. Good Luck