🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages Started by Jeroen Sat, 21 Feb 2004 22:04
problem using seial port in
#338
Author: Jeroen
Date: Sat, 21 Feb 2004 22:04
29 lines
1848 bytes
Hi,

For a project at school I need to read data from port COM2. I used som 
examples from internet and created a project on it. Running the app it 
looks like there is no COM port available.
This statment retuns null 
System.out.println((CommPortIdentifier)portList.nextElement());  Tried 
everything but something is missing.

selection of the code:
============================================
package talk2com;
import javax.comm.*;
import java.io.*;
import java.util.Enumeration;

public class Talk2Com {
   //Construct the application
   public Talk2Com(){
}

   public static void main(String[] args) throws NoSuchPortException {
     Enumeration portList = CommPortIdentifier.getPortIdentifiers();
     System.out.println((CommPortIdentifier)portList.nextElement());
}
===================================================================

Thanks Jeroen
jeroen.k@gmx.net
Re: problem using seial port in
#339
Author: Tor Iver Wilhelmsen (TeamB)
Date: Mon, 23 Feb 2004 08:10
10 lines
1356 bytes
Jeroen <jeroen@nospam.com> writes:

> For a project at school I need to read data from port COM2. I used som 
> examples from internet and created a project on it. Running the app it 
> looks like there is no COM port available.

It seems you haven't placed the native part of the JavaComm API in an
accessible place. Try putting it in the project's working folder, or
set the system property java.library.path to point at it in the run
configuration.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads