Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Java Communications API
Java Communications API [message #275875] Sun, 14 November 2004 19:38 Go to next message
Rob Greene is currently offline Rob Greene
Messages: 13
Registered: July 2009
Junior Member
Has anyone gotten the Java Communications API to work with Eclipse? I'm
trying to develop some Java code to work over either the serial port or
the parallel port, but Eclipse refuses to recognize the libraries.

For instance, I can open the type CommPortEnumerator but not compile - the
import statement has the following error message:
The imported type javax.comm.CommPortEnumerator is not visible

I do have my system setup correctly. I can go to the command-line and
compile and then execute code that sees the API fine. Eclipse just
refuses to recognize it.

Any ideas?

Thanks!
-Rob
Re: Java Communications API [message #275879 is a reply to message #275875] Sun, 14 November 2004 21:17 Go to previous messageGo to next message
Eclipse User
Originally posted by: Chris_Laffra.ca.ibm.com

Try

project properties (select project + Alt-Enter) > Java Build Path >
Libraries > Add External Jars...

Chris

"Rob Greene" <greener@charter.net> wrote in message
news:cn8c6s$hdh$1@eclipse.org...
> Has anyone gotten the Java Communications API to work with Eclipse? I'm
> trying to develop some Java code to work over either the serial port or
> the parallel port, but Eclipse refuses to recognize the libraries.
>
> For instance, I can open the type CommPortEnumerator but not compile - the
> import statement has the following error message:
> The imported type javax.comm.CommPortEnumerator is not visible
>
> I do have my system setup correctly. I can go to the command-line and
> compile and then execute code that sees the API fine. Eclipse just
> refuses to recognize it.
>
> Any ideas?
>
> Thanks!
> -Rob
>
Re: Java Communications API [message #275885 is a reply to message #275879] Sun, 14 November 2004 22:46 Go to previous messageGo to next message
Rob Greene is currently offline Rob Greene
Messages: 13
Registered: July 2009
Junior Member
No luck, unfortunately. I originally had a variable set to point at the
JAR, but that didn't work, either.

Trying to classify my problem - I can Ctrl+Shift+T and enter
CommPortEnumerator and bring up the class file. In the Java source
editor, I can auto-complete the class name for "CommPortE" and get
CommPortEnumerator. When I try to enter
"CommPortIdentifier.getPortIdentifiers();", nothing autocompletes after
the dot. Of course, everything also shows up with red squigglies...

FWIW, my JRE System Library displays comm.jar (in
c:\j2sdk1.4.2_05\jre\lib\ext) as one of the system libraries. I can click
the "+" to open the JAR file and browse the classes. I have tried
pointing at the JAR directly in the Java Build Path for the project - but
if I choose the same copy of comm.jar, it's a duplicate on the classpath.
If I choose a different copy, it doesn't help.

I've placed the JAR, DLL, and properties in various spots throught my Java
environments. If I've done anything wrong, it is having placed the files
in multiple locations. :(

Chris Laffra wrote:

> Try

> project properties (select project + Alt-Enter) > Java Build Path >
> Libraries > Add External Jars...

> Chris
Re: Java Communications API [message #275895 is a reply to message #275885] Sun, 14 November 2004 23:49 Go to previous messageGo to next message
Eclipse User
Originally posted by: Chris_Laffra.ca.ibm.com

Smells like a JDT cache inconsistency to me.

Try selecting another VM and then switch back to your current one.
See Window > Preferences > Java > Installed JREs

If that fails, I would recommend creating a new workspace and try from
there.

Finally, if all fails, reinstall Eclipse.

Chris

"Rob Greene" <greener@charter.net> wrote in message
news:cn8n81$tuk$1@eclipse.org...
> No luck, unfortunately. I originally had a variable set to point at the
> JAR, but that didn't work, either.
>
> Trying to classify my problem - I can Ctrl+Shift+T and enter
> CommPortEnumerator and bring up the class file. In the Java source
> editor, I can auto-complete the class name for "CommPortE" and get
> CommPortEnumerator. When I try to enter
> "CommPortIdentifier.getPortIdentifiers();", nothing autocompletes after
> the dot. Of course, everything also shows up with red squigglies...
>
> FWIW, my JRE System Library displays comm.jar (in
> c:\j2sdk1.4.2_05\jre\lib\ext) as one of the system libraries. I can click
> the "+" to open the JAR file and browse the classes. I have tried
> pointing at the JAR directly in the Java Build Path for the project - but
> if I choose the same copy of comm.jar, it's a duplicate on the classpath.
> If I choose a different copy, it doesn't help.
>
> I've placed the JAR, DLL, and properties in various spots throught my Java
> environments. If I've done anything wrong, it is having placed the files
> in multiple locations. :(
>
> Chris Laffra wrote:
>
> > Try
>
> > project properties (select project + Alt-Enter) > Java Build Path >
> > Libraries > Add External Jars...
>
> > Chris
>
>
Re: Java Communications API [message #275901 is a reply to message #275895] Mon, 15 November 2004 02:00 Go to previous messageGo to next message
Rob Greene is currently offline Rob Greene
Messages: 13
Registered: July 2009
Junior Member
Still no luck! I downloaded the latest 1.4.2 JDK (1.4.2_06), uninstalled
my "old" JDK and installed the new one. I renamed my old workspace and
installed a fresh copy of Eclipse 3.0.1. I created a new workspace. Same
symptoms. When running and compiling from the command-line, I'm ok. It
really sucks to not be able to use Eclipse for this...

As an FYI, here's where the Java Communications API pieces go:
1. <JRE>\bin\win32com.dll
2. <JRE>\lib\javax.comm.properties
3. <JRE>\lib\ext\comm.jar

Where JRE is one of:
a. C:\j2sdk1.4.2_06\jre
b. C:\Program Files\Java\j2re1.4.2_06

I've got two JRE's configured in Eclipse - both listed above. Both
exhibit the same behavior.

Both of these work from the command line.

Any more hints?
-Rob


Chris Laffra wrote:

> Smells like a JDT cache inconsistency to me.

> Try selecting another VM and then switch back to your current one.
> See Window > Preferences > Java > Installed JREs

> If that fails, I would recommend creating a new workspace and try from
> there.

> Finally, if all fails, reinstall Eclipse.

> Chris
Re: Java Communications API [message #276126 is a reply to message #275901] Thu, 18 November 2004 05:08 Go to previous messageGo to next message
Rob Greene is currently offline Rob Greene
Messages: 13
Registered: July 2009
Junior Member
On a whim, I tried this in Eclipse 2.1.3 to see if there was a difference.
No change.

I have not tried this with an older JVM - the compile dates on the class
files in the JAR are 1998-ish. Not sure if that helps or not.

Can someone either try this out themselves or report that they have it
working? I hate to admit that I'm rather frustrated at this point... )c:

I'm not looking forward to Textpad Java development.
-Rob

Rob Greene wrote:

> Still no luck! I downloaded the latest 1.4.2 JDK (1.4.2_06), uninstalled
> my "old" JDK and installed the new one. I renamed my old workspace and
> installed a fresh copy of Eclipse 3.0.1. I created a new workspace. Same
> symptoms. When running and compiling from the command-line, I'm ok. It
> really sucks to not be able to use Eclipse for this...

> As an FYI, here's where the Java Communications API pieces go:
> 1. <JRE>binwin32com.dll
> 2. <JRE>libjavax.comm.properties
> 3. <JRE>libextcomm.jar

> Where JRE is one of:
> a. C:j2sdk1.4.2_06jre
> b. C:Program FilesJavaj2re1.4.2_06

> I've got two JRE's configured in Eclipse - both listed above. Both
> exhibit the same behavior.

> Both of these work from the command line.

> Any more hints?
> -Rob


> Chris Laffra wrote:

>> Smells like a JDT cache inconsistency to me.

>> Try selecting another VM and then switch back to your current one.
>> See Window > Preferences > Java > Installed JREs

>> If that fails, I would recommend creating a new workspace and try from
>> there.

>> Finally, if all fails, reinstall Eclipse.

>> Chris
Re: Java Communications API [message #276128 is a reply to message #276126] Thu, 18 November 2004 07:09 Go to previous messageGo to next message
Tom Hofmann is currently offline Tom Hofmann
Messages: 770
Registered: July 2009
Senior Member
> Can someone either try this out themselves or report that they have it
> working? I hate to admit that I'm rather frustrated at this point...

Not sure what's different but I have used javacomm successfully both on
windows and linux. All I had to do is install the javacomm library (as
you describe into the JRE/lib and lib/ext folders) and ensuring it
appeared on my JRE's classpath. Everything worked as expected.

-tom
Re: Java Communications API [message #276179 is a reply to message #276128] Thu, 18 November 2004 22:41 Go to previous messageGo to next message
Rob Greene is currently offline Rob Greene
Messages: 13
Registered: July 2009
Junior Member
And it functioned within Eclipse? I haven't tried Linux yet - I'm in
Windows XP. It does work from the command-line just fine. Which is why
I'm so perplexed!!
-Rob

Tom Eicher wrote:

> > Can someone either try this out themselves or report that they have it
> > working? I hate to admit that I'm rather frustrated at this point...

> Not sure what's different but I have used javacomm successfully both on
> windows and linux. All I had to do is install the javacomm library (as
> you describe into the JRE/lib and lib/ext folders) and ensuring it
> appeared on my JRE's classpath. Everything worked as expected.

> -tom
Re: Java Communications API [message #276207 is a reply to message #276179] Fri, 19 November 2004 11:18 Go to previous messageGo to next message
Tom Hofmann is currently offline Tom Hofmann
Messages: 770
Registered: July 2009
Senior Member
Rob Greene wrote:
> And it functioned within Eclipse?

Yes, I was able to run and debug from eclipse, also on WinXP.

-tom
Re: Java Communications API [message #276226 is a reply to message #276207] Fri, 19 November 2004 16:42 Go to previous message
Rob Greene is currently offline Rob Greene
Messages: 13
Registered: July 2009
Junior Member
Well, I'll be dipped. I guess I've really missed something... I was using
CommPortEnumerator for my test - and it didn't work. I finally just
copied my code from outside of Eclipse and it used CommPortIdentifier.

And it works!

I did miss something and it is really simple! CommPortEnumerator has
package scope. (Just in case that's the wrong term - it is not a public
class.)

Sorry - and thanks for sticking with me.
-Rob


Tom Eicher wrote:

> Rob Greene wrote:
>> And it functioned within Eclipse?

> Yes, I was able to run and debug from eclipse, also on WinXP.

> -tom
Previous Topic:Feature Export Issue
Next Topic:Use Eclipse deploy operation from command line?
Goto Forum:
  


Current Time: Fri Oct 24 07:20:32 GMT 2014

Powered by FUDForum. Page generated in 0.03378 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software