Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Parallel port communication using JAVA comm.api?

843790Aug 3 2010
I am running windows XP. Trying to get control of my Parallel ports using JAVA.
But when I run the following code segment nothing shows up! I checked my device manager I have COM1 and LPT1 port in the list

Please help.. I need to control a stepper motor using the parallel port
import java.io.*;
import java.util.*;
import javax.comm.*;

public class SimpleWrite {
  public static void main(String[] args) {
    Enumeration e = CommPortIdentifier.getPortIdentifiers();
    while (e.hasMoreElements()) {
      System.out.println("HI"+(CommPortIdentifier) e.nextElement());
    }
  }
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2010
Added on Aug 3 2010
0 comments
190 views