javax.comm Libraries problems! Help me, please!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andrea_Piovesan
Posted On:   Wednesday, November 14, 2001 01:53 AM

I'm using win2k as OS I've downloaded the javacomm API's from java.sun.com site and I've installed them into my jdk1.3.1_01 Someone please tell me why this simple code doesn't work? /* * Test.java * * Created on 12 novembre 2001, 22.48 */ /** * Remove package declaration to test this class. */ package M35i; import javax.comm.*; import java.util.Enumeration; /** * RS-232 comunication test class * @author Andrea Piovesan * @version 0.0 */ public class Test {    More>>

I'm using win2k as OS

I've downloaded the javacomm API's from java.sun.com site and I've installed them into my jdk1.3.1_01

Someone please tell me why this simple code doesn't work?

/*

* Test.java

*

* Created on 12 novembre 2001, 22.48

*/



/**

* Remove package declaration to test this class.

*/

package M35i;



import javax.comm.*;

import java.util.Enumeration;



/**

* RS-232 comunication test class

* @author Andrea Piovesan

* @version 0.0

*/

public class Test {



/**

* Test method

*/

public static void main(String[] args) {

Enumeration enum = CommPortIdentifier.getPortIdentifiers();

CommPortIdentifier portID = (CommPortIdentifier) enum.nextElement();

// this output on my machine prints "null", why?!

System.out.println(portID);

}



}


Thanks a lot!

Andrea.

   <<Less

Re: javax.comm Libraries problems! Help me, please!

Posted By:   Shay_BC  
Posted On:   Saturday, February 2, 2002 11:55 AM

hi,

i had the same problem what i did is put the properties file supplied with the comm package in the classpath along with the jar file,

also make sure that you put the supplied dll (asuming win2k distribution) in the JDKin directory.

best of luck.
About | Sitemap | Contact