如何编辑 Java 库的构建属性
似乎有一些类似的问题,但没有足够具体的问题,我希望这没问题。
我想知道如何编辑 Jamod MODBUS 库的构建属性,以便使用 RxTx API 而不是已弃用的 javax.comm。图书馆页面说这是支持的:
您需要安装 Java 通信 API 扩展 (javax.comm) 的实现才能运行串行 modbus 应用程序。 请注意,还支持通过布尔构建属性 build.serial.gnu 使用 gnu.io 前缀 (RXTX) 进行构建(true 将导致构建过程在使用的源中将 javax.comm 前缀替换为 gnu.io用于构建)。
更多信息请参见:http://jamod.sourceforge.net/development/project_build.html
我不确定如何访问该文件,或者这样做的技术。我需要创建它还是编辑现有的?我在项目中寻找build.xml,但没有运气,并用谷歌搜索了很多次。非常感谢任何帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需使用 IDE (例如 Netbeans),然后用 gnu.io 替换所有出现的 javax.comm,来自 rxtx,将 RXTXcomm.jar 库添加到项目中,如果您使用的是 Windows,则将 rxtxSerial.dll 复制到例如 C:\windows\system32。
它会起作用的。祝你好运
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
如果您在 http://sourceforge.net/projects/jamod/files/jamod/1.2/jamod-1.2rc1-src.zip/download
解压后,你会发现build.xml 和 build-snap.xml,以及 build.properties 文件,它允许您指定 build.serial.gnu。
然后,您只需安装 ant 并在目录中运行它即可启动构建。
编辑:我也没有安装 Apache Forrest,它似乎用于生成文档,因此我还需要注释掉 build.xml 中对 Forrest 的所有引用。
There is a copy of a build.xml file if you download the source ZIP of version 1.2rc1 at http://sourceforge.net/projects/jamod/files/jamod/1.2/jamod-1.2rc1-src.zip/download
If you unzip, you will find build.xml and build-snap.xml, as well as the build.properties file, which lets you specify the build.serial.gnu.
You then just need to install ant and run it in the directory to initiate the build.
Edit: I also didn't have Apache Forrest installed, which appears to be using for generating the docs, so I needed to comment out all references to Forrest in the build.xml as well.