File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes COM PORTS are not shows under 64bit OS on eclipse indigo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "COM PORTS are not shows under 64bit OS on eclipse indigo" Watch "COM PORTS are not shows under 64bit OS on eclipse indigo" New topic
Author

COM PORTS are not shows under 64bit OS on eclipse indigo

Rahul Naik
Greenhorn

Joined: May 14, 2012
Posts: 4
Dear All,

Below Java program for detecting ports of PC. I am using eclipse indigo as IDE. program runs correctly but detected ports are not shows in console out put. i am using 64bit processor. JDK 1.6. i try JDK for 64bit but not working. i added all jar file RXTXComm.jat, rxtxParallel.dll, rxtxSerial.dll in the program. Please advice asap

import java.io.*;
import java.util.*;
import javax.comm.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.comm.CommPort;
import javax.comm.CommPortIdentifier;
import javax.comm.SerialPort;

public class SimpleWrite {
static Enumeration portList;
static CommPortIdentifier portId;
static String messageString = "Hello, world!\n";
static SerialPort serialPort;
static OutputStream outputStream;

public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements())
{
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
System.out.println("Port Name : "+portId);
{
System.out.println("Port Name : "+portId);

if (portId.getName().equals("COM3"))
{
//if (portId.getName().equals("/dev/term/a")) {
try
{
serialPort = (SerialPort)
portId.open("SimpleWriteApp", 2000);
}
catch (PortInUseException e)
{}
try
{
outputStream = serialPort.getOutputStream();
}
catch (IOException e)
{}
try {
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
}
catch (UnsupportedCommOperationException e)
{}
try
{
outputStream.write(messageString.getBytes());
}
catch (IOException e)
{}
}
}
}
}
}

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: COM PORTS are not shows under 64bit OS on eclipse indigo