23

I'd recently downloaded a project on SMS sending, but when I tries to compile the code it gives error on line import javax.comm.*;.

Can anybody tell me where to find javax.comm and where to place so that there will be no compilation error.

Mohammad Faisal
  • 5,783
  • 15
  • 70
  • 117

5 Answers5

28

Oracle Java Communications API Reference - http://www.oracle.com/technetwork/java/index-jsp-141752.html

Official 3.0 Download (Solarix, Linux) - http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-misc-419423.html

Unofficial 2.0 Download (All): http://www.java2s.com/Code/Jar/c/Downloadcomm20jar.htm

Unofficial 2.0 Download (Windows installer) - http://kishor15389.blogspot.hk/2011/05/how-to-install-java-communications.html

In order to ensure there is no compilation error, place the file on your classpath when compiling (-cp command-line option, or check your IDE documentation).

Sheepy
  • 17,324
  • 4
  • 45
  • 69
Ryan Schipper
  • 1,019
  • 7
  • 8
  • 2
    I'd downloaded the .zip now there is a `comm.jar` file. Did I've to set the class path to this `comm.jar` file or I will extract the `comm.jar` file? – Mohammad Faisal Sep 26 '11 at 23:51
  • 2
    Just add the comm.jar to the classpath. Don't extract it. – Ryan Schipper Sep 27 '11 at 00:02
  • 1
    so by putting `comm.jar` in classpath I don't need have to change the code for `import javax.comm.*;`? – Mohammad Faisal Sep 27 '11 at 00:11
  • You have to import the classes you wish to use, along with adding comm.jar to the classpath. – Tanner Sep 27 '11 at 00:53
  • @Ryan Schipper:there's only jar file but no API-documentation? How could I get that? And is there's no new link to download this API? – Mohammad Faisal Aug 03 '12 at 02:51
  • @RyanSchipper does this create dependencies on the machine that an application (which uses the Communication API) is going to be deployed? – Saher Ahwal Mar 13 '13 at 06:25
  • @Saher an application that uses the Communication API will require an implementation of the Communication API (such as the linked download). And of course, Java Runtime Environment. – Ryan Schipper Apr 05 '13 at 01:25
  • @DmitrySandalov Thanks - I have edited the post to include the java2s link. – Ryan Schipper Apr 02 '14 at 04:43
  • Is that the most recent version? Is it discontinued? It looks like a download site that hoards jar files indiscriminately, that isn't maintained by the authors of javacomm. – Mark Jeronimus Sep 17 '14 at 11:44
  • 1
    @MarkJeronimus: The latest official version does not support Windows. I have added the official download link and rearranged the links. – Sheepy Dec 05 '14 at 08:28
20

Use RXTX.

On Debian install librxtx-java by typing:

sudo apt-get install librxtx-java

On Fedora or Enterprise Linux install rxtx by typing:

sudo yum install rxtx
Cristian Ciupitu
  • 20,270
  • 7
  • 50
  • 76
Anony
  • 209
  • 2
  • 2
2

you can find Java Communications API 2.0 in below link

http://www.java2s.com/Code/Jar/c/Downloadcomm20jar.htm

electro
  • 141
  • 4
1

Another Simple way i found in Netbeans right click on your project>libraris click add jar/folder add your comm.jar and you done.

if you dont have comm.jar download it from >>> http://llk.media.mit.edu/projects/picdev/software/javaxcomm.zip

M.ilyas
  • 19
  • 1
0

On ubuntu

 sudo apt-get install librxtx-java then 

add RXTX jars to the project which are in

 usr/share/java
samayo
  • 16,163
  • 12
  • 91
  • 106
misman
  • 1,347
  • 3
  • 21
  • 39