Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Error loading SolarisSerial

Reply
Thread Tools

Error loading SolarisSerial

 
 
quad
Guest
Posts: n/a
 
      03-14-2007

> comm.jar goes in JDK/jre/lib/ext and JRE/lib/ext
> javax.comm.properties goes in JRE/lib
> win32com.dll goes in JRE/bin
>

I have set the above paths.

> JDK is the base directory of your JDK installation. On my system that
> is C:\Program Files\Java\jdk1.6.0\
>
> JRE is the base directory of your JRE installation. On my system that
> is C:\Program Files\Java\jre1.6.0\


I'm using j2sdk1.4.2_05 and windows 2000. Hope that shouldn't be the
problem.
> If any of the files are in the wrong directories it won't work even
> though it may compile. All that is required for it to compile is to
> have the comm.jar file in your path or the extension directory (where it
> belongs).


import java.io.*;
import java.util.*;
import javax.comm.*;

public class CheckPort {
public CheckPort() {
CommPortIdentifier cpi = null;

Enumeration e = CommPortIdentifier.getPortIdentifiers();

while (e.hasMoreElements()) {
try {
cpi = (CommPortIdentifier) e.nextElement();
} catch (NoSuchElementException n) {}
System.out.println(cpi.getName());
}
System.out.println("done");
}
public static void main(String[] args) { new CheckPort(); }

}

The above program compiles, and prints only "done" when run.(that
means it does run properly?!) It doesn't ennumerate any serial ports,
even though COM1 port is connected to serial port of 8051
microcontroller.

>This should work for any real serial port. I don't know if
> it will work with the USB->serial devices.


Its not a USB serial device. Here's a snapshot of my setup. It has the
virtex board on the left, and the 8051 microcontroller on the right,
whose serial port I'm trying to connect to the PC:

http://www.esnips.com/doc/e646fd74-9...c0/board_setup

I'm using the serial cable supplied along with the kit and it does
give me the right output on a hyperterminal. I read somewhere that
these serial devices work on java and C till win98, and for later
versions, I'd have to write my own device drivers. Is that true?

> Let us know if you get it going.
>

Waiting for your response.
Thanks
Quad


 
Reply With Quote
 
 
 
 
Knute Johnson
Guest
Posts: n/a
 
      03-14-2007
quad wrote:
>> comm.jar goes in JDK/jre/lib/ext and JRE/lib/ext
>> javax.comm.properties goes in JRE/lib
>> win32com.dll goes in JRE/bin
>>

> I have set the above paths.
>
>> JDK is the base directory of your JDK installation. On my system that
>> is C:\Program Files\Java\jdk1.6.0\
>>
>> JRE is the base directory of your JRE installation. On my system that
>> is C:\Program Files\Java\jre1.6.0\

>
> I'm using j2sdk1.4.2_05 and windows 2000. Hope that shouldn't be the
> problem.
>> If any of the files are in the wrong directories it won't work even
>> though it may compile. All that is required for it to compile is to
>> have the comm.jar file in your path or the extension directory (where it
>> belongs).

>
> import java.io.*;
> import java.util.*;
> import javax.comm.*;
>
> public class CheckPort {
> public CheckPort() {
> CommPortIdentifier cpi = null;
>
> Enumeration e = CommPortIdentifier.getPortIdentifiers();
>
> while (e.hasMoreElements()) {
> try {
> cpi = (CommPortIdentifier) e.nextElement();
> } catch (NoSuchElementException n) {}
> System.out.println(cpi.getName());
> }
> System.out.println("done");
> }
> public static void main(String[] args) { new CheckPort(); }
>
> }
>
> The above program compiles, and prints only "done" when run.(that
> means it does run properly?!) It doesn't ennumerate any serial ports,
> even though COM1 port is connected to serial port of 8051
> microcontroller.
>
>> This should work for any real serial port. I don't know if
>> it will work with the USB->serial devices.

>
> Its not a USB serial device. Here's a snapshot of my setup. It has the
> virtex board on the left, and the 8051 microcontroller on the right,
> whose serial port I'm trying to connect to the PC:
>
> http://www.esnips.com/doc/e646fd74-9...c0/board_setup
>
> I'm using the serial cable supplied along with the kit and it does
> give me the right output on a hyperterminal. I read somewhere that
> these serial devices work on java and C till win98, and for later
> versions, I'd have to write my own device drivers. Is that true?
>
>> Let us know if you get it going.
>>

> Waiting for your response.
> Thanks
> Quad
>
>


I've used the Java Comm API with 1.4.2 so that shouldn't be a problem.
I have never used Windows 2000 however. All of my current work is with
XP and the Comm API works fine with XP.

The test program should enumerate ports whether or not they are
connected to a cable and other port. So the only thing I can suggest
now is to double check that the files are in the right places,
especially the javax.comm.properties file. If you can get a hold of a
Windows 98 or XP computer, try and see if you can list the ports on that
computer.

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
 
 
 
quad
Guest
Posts: n/a
 
      03-15-2007
Will you be able to mail me a copy of java.comm.properties file, jus
in case mine was corrupt?

 
Reply With Quote
 
quad
Guest
Posts: n/a
 
      03-15-2007
I reinstalled java and jre on my system, made the path changes, and
the serial port finally did work. Thanks a lot for your support!
Regards
Quad

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
order of iframe loading with document loading ofir Javascript 0 12-03-2007 12:06 PM
loading image -> detect when image is done loading edfialk Javascript 0 05-10-2007 07:28 PM
[OT] Is loading the second Java application faster than loading the first? David Segall Java 2 01-02-2007 04:41 PM
Image loading using javascript. Handling timeouts and parrallel loading under IE zborisau@gmail.com Javascript 4 08-28-2005 02:02 PM
smtpmail send error (Access Denied or Error loading type library/DLL) Erwan ASP .Net 0 04-02-2004 02:14 PM



Advertisments