File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Port programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Port programming" Watch "Port programming" New topic

Port programming

Darryl Sumner

Joined: Jul 26, 2012
Posts: 3

I have looked found a lot of articles on the net about Java port programming on the net, but they end up involving other languages. So here's my question, Is it possible to program computer hardware like parallel ports directly in Java or does a native method have to be used. I'm into building automation and programming robotics using the Parallax stamps but want to venture into programming the parallel port to use LEDs to begin my journey into hardware programming with Java.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41134
Yep, that's possible. See, particularly the chapter "All About Sockets".

Ping & DNS - my free Android networking tools app
Marco Ehrentreich
best scout

Joined: Mar 07, 2007
Posts: 1280

@Ulf: I guess, Darryl wasn't asking for ports as in UDP/TCP port but instead wanted to know how to handle serial/parallel ports in Java ;-)

In general that's possible but you'll need a library with some native support. At least I don't know of a pure Java solution. The only library I know for programming serial/parallel ports in Java is RXTX although I must admit I don't know if this is a very portable solution which works on any platform. Perhaps you should have a look at the examples and just give it a try.

Tony Docherty

Joined: Aug 07, 2007
Posts: 2173
There is also the Java Comms Package which works on Solaris and Linux but not Windows. I used the RXTX package on a Windows system many, many moons ago and from memory it worked well and I believe it also works on Linux.
Darryl Sumner

Joined: Jul 26, 2012
Posts: 3

Thanks for the help guys. I got a book called Serial Port Complete. It's a pretty good read so far.
Consider Paul's rocket mass heater.
subject: Port programming
Similar Threads
I need matrial for java and hardware programming and control PCI and peripherals
What will be the future of my Java development Career?
JDBC - Connection Refused Error. Connecting (trying) to Oracle DB.
I need matrial for java and hardware programing or control PCI and peripherals
Shifting from Java to .net