AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem using seial port

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware
View previous topic :: View next topic  
Author Message
jeroen
Guest





PostPosted: Sat Feb 21, 2004 11:04 pm    Post subject: problem using seial port Reply with quote



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
[email]jeroen.k (AT) gmx (DOT) net[/email]

Back to top
William Brogden
Guest





PostPosted: Sun Feb 22, 2004 4:02 pm    Post subject: Re: problem using seial port Reply with quote




"jeroen" <jeroen (AT) nospam (DOT) com> wrote

Quote:
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.

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_HOMEjrelib



Quote:

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
[email]jeroen.k (AT) gmx (DOT) net[/email]





----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Back to top
jeroen
Guest





PostPosted: Sun Feb 22, 2004 8:19 pm    Post subject: Re: problem using seial port Reply with quote



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

William Brogden wrote:
Quote:
"jeroen" <jeroen (AT) nospam (DOT) com> wrote in message
news:103fp0hmv7q5ff5 (AT) corp (DOT) supernews.com...

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.


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_HOMEjrelib




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
[email]jeroen.k (AT) gmx (DOT) net[/email]






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.