1

似乎有一些类似的问题,但没有足够具体的问题,我希望这没问题。

我想知道如何编辑 Jamod MODBUS 库的构建属性,以便使用 RxTx API 而不是已弃用的 javax.comm。图书馆页面说这是支持的:

您将需要安装 Java 通信 API 扩展 (javax.comm) 的实现,以便能够运行串行 modbus 应用程序。请注意,还支持使用 gnu.io 前缀 (RXTX) 进行构建,通过布尔构建属性 build.serial.gnu (true 将导致构建过程将 javax.comm 前缀替换为使用的源中的 gnu.io用于构建)。

更多信息在这里:http: //jamod.sourceforge.net/development/project_build.html

我不确定如何访问这个文件,或者这样做的技术。我需要创建它还是编辑现有的?我已经在项目中寻找 build.xml,但没有运气,并且谷歌搜索了很多次。非常感谢任何帮助。

4

3 回答 3

0
The " Modbus Jamod Project - Original " folder contains the original project is available at
Web http://jamod.sourceforge.net/ . This project has a significant dependence :

[1 ] javax.comm : comm : jar :3.0 -u1
Description : The Java Communications 3.0 API is a Java extension That Facilitates develop developing platform -independent communications applications for technologies : such as Smart Cards , embedded systems, and point -of -sale devices , financial services devices , fax , modems, display terminals , and robotic equipment .

This API is not available from Oracle repositories .

That's why you have to open the " Jamod -1.2 -SNAPSHOT - sources.jar " project and recompile using other libraries for serial communication. This project is now ready to " Modbus Jamod Project with CXR " to 64 Bits.




METHOD OF SOLUTION OF DEPENDENCE
-------------------------------------------

To recompile the Jamod (Modbus Jamod Project - Original) project, you must open the project with Netbeans clear the javax.comm library , and replaced with the rxtx library. CXR This library can be selected which are in the " CXR - Serial comms Java " folder , ie :
[1 ] MFZ - rxtx -2.2- 20081207 -linux- i386
[2 ] MFZ - rxtx -2.2- 20081207 -x86_64 -linux
[3 ] MFZ - rxtx -2.2- 20081207 -win- ia64
[4 ] MFZ - rxtx -2.2- x64 -win- 20081207
[5 ] MFZ - rxtx -2.2- x86 -win- 20081207

We must take into account the following when choosing :

Windows
-------

Select a binary build - x64 or x86 (based on Which version of
the JVM you are installing to)

NOTE : You MUST match your architecture . You can not install the i386
version on a 64 - bit version of the JDK and vice - versa.

For a JDK installation:

Copy RXTXcomm.jar ---> <JAVA_HOME> \ jre \ lib \ ext
Copy rxtxSerial.dll ---> <JAVA_HOME> \ jre \ bin
Copy rxtxParallel.dll ---> <JAVA_HOME> \ jre \ bin

Linux
-----

Select a binary build - x86_64 or i386 (based on Which version of
the JVM you are installing to)

NOTE : You MUST match your architecture . You can not install the i386
version on a 64 - bit version of the JDK and vice - versa.

For a JDK installation on i386 architecture =

Copy RXTXcomm.jar ---> <JAVA_HOME> / jre / lib / ext
Copy librxtxSerial.so ---> <JAVA_HOME> / jre/lib/i386 /
Copy librxtxParallel.so ---> <JAVA_HOME> / jre/lib/i386 /

NOTE : For a JDK installation on architecture = x86_64 , just change the
i386 to x86_64 above.

-------------------------------------------------- -----------------------------------------------

After this replace the javax.comm library , the Jamod (Modbus Jamod Project - Original) project is recompiled , and the generated Jar Crossover is added.

When the Crossover project contains the library Jamod repaired , it will have to also add the RXTX library to Crossover.

Done.

-------------------------------------------------- -----------------------------------------------
于 2013-11-29T13:54:59.760 回答
0

只需使用 IDE(例如 Netbeans)打开项目源代码(您可以从rxtx下载它),然后从 rxtx 将 javax.comm 的每个外观替换为gnu.io,将 RXTXcomm.jar 库添加到项目中,如果您正在使用windows 然后将 rxtxSerial.dll 复制到 C:\windows\system32。

它会起作用的。祝你好运

于 2011-11-25T02:57:25.587 回答
0

如果您在http://sourceforge.net/projects/jamod/files/jamod/1.2/jamod-1.2rc1-src.zip/download下载版本 1.2rc1 的源 ZIP,则会有一个 build.xml 文件的副本

如果您解压缩,您将找到 build.xml 和 build-snap.xml,以及 build.properties 文件,它允许您指定 build.serial.gnu。

然后,您只需要安装 ant 并在目录中运行它即可启动构建。

编辑:我也没有安装 Apache Forrest,它似乎用于生成文档,所以我还需要在 build.xml 中注释掉对 Forrest 的所有引用。

于 2014-03-28T15:04:28.543 回答