Link all Java and native libraries to the project
Link the XBee Java Library, the RXTX library (including the native one), and the logger library to the project.
Ensure that you have downloaded and unzipped the XBJL_X.Y.Z.zip library.
Option 1 - Eclipse
- Go to the Libraries tab of the New Java Project window.
- Click Add External JARs....
- In the JAR Selection window, search the folder where you unzipped the XBee Java Library and open the xbjli b-X.Y.Z.jar file.
- Click Add External JARs... again.
- Go to the extra-libs folder and select the following files:
- rxtx-2.2.jar
- slf4j-api-x.y.z.jar
- slf4j-nop-x.y.z.jar
- Expand the rxtx-2.2.jar file of the Libraries tab list, select Native library location, and click Edit….
- Click External folder... to navigate to the extra-libs\native\Windows\win32 folder of the directory where you unzipped the XBee Java Library file (XBJL_X.Y.Z.zip).
- Windows\win32 must be replaced by the right directory that matches your operating system and the Java Virtual Machine installed (32 or 64 bits).
Tip In this last step, select the folder that matches your operating system and the Java Virtual Machine installed (32 or 64 bits). If you don't know which Java Virtual Machine is installed in your computer, open a terminal or command prompt and execute java -version.
- Click OK to add the path to the native libraries.
- Click Finish.
or
Option 2 - NetBeans
- From Projects view, right-click your project and go to Properties.
- In the categories list on the left, go to Libraries and click Add JAR/Folder.
- In the Add JAR/Folder window, search the folder where you unzipped the XBee Java Library and open the xb jlib-X.Y.X.jar file.
- Click Add JAR/Folder again.
- Go to the extra-libs folder and select the following files:
- rxtx-2.2.jar
- slf4j-api- x.y.z .jar
- slf4j-nop- x.y.z .jar
- Select Run in the left tree of the Properties dialog.
- In the VM Options field, add the following option:
-Djava.library.path=<path_where_the_XBee_Java_Library_is_unzipped>\extra-libs\nat ive\Windows\win32
where,- <path_where_the_XBee_Java_Library_is_unzipped> must be replaced by the absolute path of the directory where you unzipped the XBee Java Library file (XBJL_X.Y.Z.zip).
- Windows\win32 must be replaced by the right directory that matches your operating system and the Java Virtual Machine installed (32 or 64 bits).
- Click OK.