Hello Everyone...,
This post is about Configuring Eclipse IDE to work with javax.comm Api , so that we can read or write from Serial Port [RS232].
This post is about Configuring Eclipse IDE to work with javax.comm Api , so that we can read or write from Serial Port [RS232].
We can do this by using any one api :
- Java Communication Api (javax.comm) or
- RXTX ( gnu.io)
both are same RXTX is a 3rd party API the only difference is we need to use
import gnu.io.*; instead of
javax.comm.*; Rest everything is same.
Here I'm gonna use RXTX API.
You can Download it from here : http://rxtx.qbang.org/wiki/index.php/Download
Configuring both the api's require same steps., we just add the jar files to our Eclipse Project Build path.
[ IF YOU ARE NOT AWARE OF , HOW TO ADD JAR FILE TO ECLIPSE PROJECT
SEE MY OTHER POST http://kishor15389.blogspot.in/2012/06/adding-jar-files-to-your-project-in.html ]
import gnu.io.*; instead of
javax.comm.*; Rest everything is same.
Here I'm gonna use RXTX API.
You can Download it from here : http://rxtx.qbang.org/wiki/index.php/Download
Configuring both the api's require same steps., we just add the jar files to our Eclipse Project Build path.
[ IF YOU ARE NOT AWARE OF , HOW TO ADD JAR FILE TO ECLIPSE PROJECT
SEE MY OTHER POST http://kishor15389.blogspot.in/2012/06/adding-jar-files-to-your-project-in.html ]
And the trick part is adding Native Libraries like DLL(on Windows ) or SO(on Linux).
So Lets get Started.
- First Download the RXTX api from above mentioned Link.
- Extract to any Location.
- Right Click on you Eclipse Project (in Package Explorer on Left Panel).
- Select "Build Path".
- Click "Configure Build Path" .( A new Window will Open)
- Select "Add External Jars" under "Libraries" tab.(It will open a File Chooser)
- Select "RXTXcomm.jar".[Now our Jar File is Added and we need to attach the Native Library File to our Jar File(RXTXcomm.jar).]
- Under "Libraries" Expand the JAR file "RXTXcomm.jar" (using '+' icon at start of RXTXcomm.jar name)
- Select the "Native Library Location"
- Click "Edit" (It will open new Window)
- Click "External Folder" button ( A File Chooser will open )
- Now browse to the downloaded RXTX api folder open the appropriate OS folder and select the folder where native library files are located. [ Example on Windows OS ..\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\ is the location of DLL files. ]
- Click OK and everything is done.
Remember to change or use import gnu.io.*; instead of javax.comm.*; If you are using RXTX API.
You can see the following video, Demonstrated the all of the above steps.
... " You have no idea how happy you'll feel,
standing in its Shade when it grows up "....