如何编辑Java库的构建属性

时间:2011-05-25 16:44:12

标签: modbus

似乎有一些类似的问题,但没有什么特别的,我希望这没关系。

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

  

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

此处有更多信息:http://jamod.sourceforge.net/development/project_build.html

我不确定如何访问此文件或执行此操作的技巧。我需要创建它还是编辑现有的?我在项目中寻找build.xml,但没有运气,并多次使用Google搜索。非常感谢任何帮助。

3 个答案:

答案 0 :(得分:0)

使用IDE(例如Netbeans)打开proyect源(可以从rxtx下载),然后从rxtx替换gnu.io的javax.comm的每个外观,添加RXTXcomm .jar要项目的库,如果你使用的是windows,那么请将rxtxSerial.dll复制到C:\ windows \ system32。

它会起作用。祝你好运

答案 1 :(得分: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.

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

答案 2 :(得分: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的引用。