Skip to main content

Java Communications API – Configuration How To

Java Communication API is an extension from Sun to program for Serial/Parallel ports. Sun’s implementation of this specification can be found at "http://java.sun.com/products/javacomm", there is also a third party Open Source implementation available at "http://rxtx.qbang.org/wiki/index.php/Main_Page". Java is platform Independent, but you need some platform specific implementation to access Serial/Parallel ports, and that is why you need to do some extra work to use Java Communication API.
First download the API binaries from "http://rxtx.qbang.org/wiki/index.php/Download" page. Extract it and follow the steps given below for Windows platform.
If you are just trying execute programs already written using just JRE, then
  • Copy rxtxParallel.dll to JRE_HOME\bin\
  • Copy rxtxSerial.dll to JRE_HOME\bin\
  • Copy RXTXcomm.jar to JRE_HOME\lib\ext\
If you are writing you own applications/programs, compiling and executing them, then
  • Copy rxtxParallel.dll to JDK_HOME\jre\bin\
  • Copy rxtxSerial.dll to JDK_HOME\jre\bin\
  • Copy RXTXcomm.jar to JDK_HOME\jre\lib\ext\
You can skip the last step of copying "RXTXcomm.jar" to "..\jre\lib\ext" directory and adding it to your CLASSPATH yourself and bundling it with your application itself.
That is it, you can find more information about RXTX implementation at "http://rxtx.qbang.org/wiki/index.php/Main_Page" and about installation for different platforms like Linux, Mac at "http://rxtx.qbang.org/wiki/index.php/Installation".
Simple example about using Java Communications API will follow soon.

Comments

Popular posts from this blog

Hosting Multiple Domains In Tomcat

Tomcat allows us to host multiple domains in one instance, using multiple ' Host ' tags. In this article I will explain how to do it on Tomcat. This is very simple configuration using ' Host ' tags in your server.xml . A novice can also understand this configuration very easily. Before going into the details of the configuration first lets have a look at the ' Host ' tag, ' Context ' tag and ' Alias ' tags first. <Host name="domain1" appBase="[application base]" autoDeploy="[true/false]" unpackWARs="[true/false]"> <Alias>...</Alias> <Context path="" docBase="" reloadable="[true/false]"/> </Host> First lets have a look at ' Alias ' tag. This tag is used to provide aliases for your actual domain. For example you have a domain called 'domain1.com', and you want to run the same application for 'www.do...

Simple Accordion using Java Script and CSS

Well you can find many online, but it's difficult to find one with out any dependent API. Most of the available accordions use other APIs for animation and other stuff. For those who just want accordion with out any other stuff, this one is the perfect one. It's very simple and you don't have to be a geek to understand it. Basic knowledge of Java script and CSS will do to understand how this works. In this article I'll take you through the steps of developing an accordion. Couple of minutes you are ready to write your own. Well then let's start developing one. Layout of the HTML block looks something like the one below Lets look at the CSS first which is very simple. /** container styles **/ .ra-p, .ra-cp { padding: 0 0 0.1em; } /**** heading styles ****/ .ra-p h2, .ra-cp h2 { margin: 0px; padding: 0.2em; cursor: pointer; color: #fff; background-color: #3d80b0; } /**** collapsed heading styles ****/ .ra-cp h...