Re: Serial Port problem
From: nik[no-spam]cross (_at_wet-wired.com)
Date: 09/03/04
- Next message: sravan: "Java Regular Expression throws StackOverflow Exception"
- Previous message: nik[no-spam]cross: "Re: in my applet I can't get the stop() and the start() to fire"
- In reply to: <- Chameleon ->: "Re: Serial Port problem"
- Next in thread: <- Chameleon ->: "Re: Serial Port problem"
- Reply: <- Chameleon ->: "Re: Serial Port problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 03 Sep 2004 17:39:53 +0100
<- Chameleon -> wrote:
>>>>>Enumeration portList = CommPortIdentifier.getPortIdentifiers();
>>>>>
>>>>>this command returns an empty Enumeration. Why?
>>>>>
>>>>>My system is PC with WinXP.
>>>>>I have 1 parallel and 2 serial ports
>>>>>
>>>>>
>>>>
>>>>As a first thought, have you initialized the comm driver.
>>>>I forgot and couldn't see any ports until I used this:
>>>>
>>>> String driverName = "com.sun.comm.Win32Driver";
>>>> try{
>>>> CommDriver commdriver =
>>>>(CommDriver)Class.forName(driverName).newInstance();
>>>> commdriver.initialize();
>>>> }
>>>> catch (Exception e2)
>>>> {
>>>> e2.printStackTrace();
>>>> }
>>>>
>>>>If this doesn't help maybe you could post your code.
>>>
>>>
>>>I have javax.comm.properties file inside <java dir>\lib directory and
>
> this
>
>>>file have this line inside:
>>>-------------
>>>Driver=com.sun.comm.Win32Driver
>>>-------------
>>>Your code works and thankyou, but why I must load dynamically this
>
> driver?
>
>>>If I want to run this code in Linux or other platform?
>>>
>>>Thanks again!
>>>
>>>
>>
>>If that works my first thought would be that you do not have your java
>>lib path set up correctly. What environment/IDE are you developing in?
>>Do you have multiple JREs installed and if so have you installed the
>>Java comm api in the one ypu are running?
>
>
> I have 3 JRE in my machine.
> 1 with Borland J Builder
> 1 the original from Sun
> 1 with Mathematica
>
> I have installed comm in both Borland J Builder and Sun's stand-alone
>
>
After a quick google I found this:
What you have to do is to copy
1) win32com.dll to directory : JBuilder3/bin
2) javax.comm.properties to directory : JBuilder3/jre/lib
3) comm.jar to directory : JBuilder3/lib
http://forum.java.sun.com/thread.jsp?thread=14251&forum=8&message=35130
I hope this helps.
- Next message: sravan: "Java Regular Expression throws StackOverflow Exception"
- Previous message: nik[no-spam]cross: "Re: in my applet I can't get the stop() and the start() to fire"
- In reply to: <- Chameleon ->: "Re: Serial Port problem"
- Next in thread: <- Chameleon ->: "Re: Serial Port problem"
- Reply: <- Chameleon ->: "Re: Serial Port problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|