2011-05-25 47 views
1

似乎有一些類似的問題,但沒有足夠具體,我希望這是好的。如何編輯Java庫的構建屬性

我在想如何編輯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,但沒有運氣,並且搜索了很多次。非常感謝任何幫助。

回答

0

只要打開proyect源與IDE(例如Netbeans的)(你可以從rxtx下載),然後通過gnu.io取代javax.comm的每一次亮相,從rxtx,RXTXcomm.jar庫添加到項目,如果您使用的是Windows,那麼複製並將rxtxSerial.dll例如複製到C:\ windows \ system32。

它會工作。好運

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. 

-------------------------------------------------- ----------------------------------------------- 
0

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

如果你解壓縮,你會發現build.xml文件和構建單元。 xml以及build.properties文件,它可以讓你指定build.serial.gnu。

然後您只需安裝ant並在目錄中運行它以啓動構建。

編輯:我也沒有安裝Apache Forrest,它似乎用於生成文檔,所以我需要在build.xml中註釋所有對Forrest的引用。