 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
jeroen Guest
|
Posted: Sat Feb 21, 2004 11:04 pm Post subject: problem using seial port |
|
|
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
|
Posted: Sun Feb 22, 2004 4:02 pm Post subject: Re: problem using seial port |
|
|
"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
|
Posted: Sun Feb 22, 2004 8:19 pm Post subject: Re: problem using seial port |
|
|
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 |
|
 |
|
|
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
|
|