Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / February 2004

Tip: Looking for answers? Try searching our database.

problem using seial port

Thread view: 
jeroen - 21 Feb 2004 23:04 GMT
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
William Brogden - 22 Feb 2004 16:02 GMT
> Hi,
>
[quoted text clipped - 4 lines]
> System.out.println((CommPortIdentifier)portList.nextElement());  Tried
> everything but something is missing.

The usual reason for this is that you don't have the javax.comm.properties
file
in the right place. Try putting it in JAVA_HOME\jre\lib

> selection of the code:
> ============================================
[quoted text clipped - 16 lines]
> Thanks Jeroen
> jeroen.k@gmx.net
jeroen - 22 Feb 2004 20:19 GMT
William,

thanks for your support I placed tha file javax.comm.properties and
win32com.dll in the JBuilder ..\lib iso the ..\jdk.. dir. Followed your
advice and everything works fine. :-)

greetings Jeroen

>>Hi,
>>
[quoted text clipped - 33 lines]
> http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
> ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.