Results 1 to 9 of 9

Thread: java api doc

  1. #1
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    Question java api doc


    Hi all,
    I have found some code in google on sms pack it has 5 programs in it.My problem is it has some user defined packages and interfaces which are to be downloaded using api doc. how can i download those user defined packages is it possible to do so ????:)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    Your question just doesn't make any sense. API documentation isn't a download tool, for one.

    I suggest you go through this web page and rephrase your question.
    How To Ask Questions The Smart Way

    db

  3. #3
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    Default

    Dear Darryl,

    I am sorry I could'nt phrase the question correctly as I am new to java I still have some doubts ok I am copying my entire code and errors below please rectify those errors

    This is the code i am trying to run
    public class SMSClient implements Runnable{

    public final static int SYNCHRONOUS=0;
    public final static int ASYNCHRONOUS=1;
    private Thread myThread=null;

    private int mode=-1;
    private String recipient=null;
    private String message=null;

    public int status=-1;
    public long messageNo=-1;


    public SMSClient(int mode) {
    this.mode=mode;
    }

    public int sendMessage (String recipient, String message){
    this.recipient=recipient;
    this.message=message;
    //System.out.println("recipient: " + recipient + " message: " + message);
    myThread = new Thread(this);
    myThread.start();
    // run();
    return status;
    }
    public void run(){

    Sender aSender = new Sender(recipient,message);

    try{
    //send message
    aSender.send ();

    // System.out.println("sending ... ");

    //in SYNCHRONOUS mode wait for return : 0 for OK, -2 for timeout, -1 for other errors
    if (mode==SYNCHRONOUS) {
    while (aSender.status == -1){
    myThread.sleep (1000);
    }
    }
    if (aSender.status == 0) messageNo=aSender.messageNo ;

    }catch (Exception e){

    e.printStackTrace();

    }

    this.status=aSender.status ;

    aSender=null;


    }
    }
    And these are the errors

    .\SerialConnection.java:1: package javax.comm does not exist
    import javax.comm.*;
    ^
    .\SerialConnection.java:12: cannot find symbol
    symbol: class SerialPortEventListener
    public class SerialConnection implements SerialPortEventListener,
    ^
    .\SerialConnection.java:13: cannot find symbol
    symbol: class CommPortOwnershipListener
    CommPortOwnershipListener {
    ^
    .\SerialParameters.java:32: package javax.comm does not exist
    import javax.comm.*;
    ^
    .\SerialConnection.java:25: cannot find symbol
    symbol : class CommPortIdentifier
    location: class SerialConnection
    private CommPortIdentifier portId;
    ^
    .\SerialConnection.java:26: cannot find symbol
    symbol : class SerialPort
    location: class SerialConnection
    private SerialPort sPort;
    ^
    .\SerialConnection.java:241: cannot find symbol
    symbol : class SerialPortEvent
    location: class SerialConnection
    public void serialEvent(SerialPortEvent e) {
    ^
    .\SerialConnection.java:70: cannot find symbol
    symbol : variable CommPortIdentifier
    location: class SerialConnection
    portId = CommPortIdentifier.getPortIdentifier(parameters.ge tPor
    ());
    ^
    .\SerialConnection.java:71: cannot find symbol
    symbol : class NoSuchPortException
    location: class SerialConnection
    } catch (NoSuchPortException e) {
    ^
    .\SerialConnection.java:87: cannot find symbol
    symbol : class SerialPort
    location: class SerialConnection
    sPort = (SerialPort)portId.open("SMSConnector", 30000);
    ^
    .\SerialConnection.java:88: cannot find symbol
    symbol : class PortInUseException
    location: class SerialConnection
    } catch (PortInUseException e) {
    ^
    .\SerialConnection.java:139: cannot find symbol
    symbol : class UnsupportedCommOperationException
    location: class SerialConnection
    } catch (UnsupportedCommOperationException e) {
    ^
    .\SerialConnection.java:169: cannot find symbol
    symbol : class UnsupportedCommOperationException
    location: class SerialConnection
    } catch (UnsupportedCommOperationException e) {
    ^
    .\SerialConnection.java:181: cannot find symbol
    symbol : class UnsupportedCommOperationException
    location: class SerialConnection
    } catch (UnsupportedCommOperationException e) {
    ^
    .\SerialConnection.java:252: cannot find symbol
    symbol : variable SerialPortEvent
    location: class SerialConnection
    case SerialPortEvent.DATA_AVAILABLE:
    ^
    .\SerialConnection.java:276: cannot find symbol
    symbol : variable SerialPortEvent
    location: class SerialConnection
    case SerialPortEvent.BI:
    ^
    .\SerialParameters.java:54: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    SerialPort.FLOWCONTROL_NONE,
    ^
    .\SerialParameters.java:55: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    SerialPort.FLOWCONTROL_NONE,
    ^
    .\SerialParameters.java:56: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    SerialPort.DATABITS_8,
    ^
    .\SerialParameters.java:57: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    SerialPort.STOPBITS_1,
    ^
    .\SerialParameters.java:58: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    SerialPort.PARITY_NONE );
    ^
    .\SerialParameters.java:216: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.databits = SerialPort.DATABITS_5;
    ^
    .\SerialParameters.java:219: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.databits = SerialPort.DATABITS_6;
    ^
    .\SerialParameters.java:222: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.databits = SerialPort.DATABITS_7;
    ^
    .\SerialParameters.java:225: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.databits = SerialPort.DATABITS_8;
    ^
    .\SerialParameters.java:243: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.DATABITS_5:
    ^
    .\SerialParameters.java:245: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.DATABITS_6:
    ^
    .\SerialParameters.java:247: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.DATABITS_7:
    ^
    .\SerialParameters.java:249: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.DATABITS_8:
    ^
    .\SerialParameters.java:270: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.stopbits = SerialPort.STOPBITS_1;
    ^
    .\SerialParameters.java:273: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.stopbits = SerialPort.STOPBITS_1_5;
    ^
    .\SerialParameters.java:276: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.stopbits = SerialPort.STOPBITS_2;
    ^
    .\SerialParameters.java:294: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.STOPBITS_1:
    ^
    .\SerialParameters.java:296: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.STOPBITS_1_5:
    ^
    .\SerialParameters.java:298: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.STOPBITS_2:
    ^
    .\SerialParameters.java:319: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.parity = SerialPort.PARITY_NONE;
    ^
    .\SerialParameters.java:322: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.parity = SerialPort.PARITY_EVEN;
    ^
    .\SerialParameters.java:325: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    this.parity = SerialPort.PARITY_ODD;
    ^
    .\SerialParameters.java:343: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.PARITY_NONE:
    ^
    .\SerialParameters.java:345: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.PARITY_EVEN:
    ^
    .\SerialParameters.java:347: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.PARITY_ODD:
    ^
    .\SerialParameters.java:362: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    return SerialPort.FLOWCONTROL_NONE;
    ^
    .\SerialParameters.java:365: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    return SerialPort.FLOWCONTROL_XONXOFF_OUT;
    ^
    .\SerialParameters.java:368: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    return SerialPort.FLOWCONTROL_XONXOFF_IN;
    ^
    .\SerialParameters.java:371: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    return SerialPort.FLOWCONTROL_RTSCTS_IN;
    ^
    .\SerialParameters.java:374: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    return SerialPort.FLOWCONTROL_RTSCTS_OUT;
    ^
    .\SerialParameters.java:376: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    return SerialPort.FLOWCONTROL_NONE;
    ^
    .\SerialParameters.java:387: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.FLOWCONTROL_NONE:
    ^
    .\SerialParameters.java:389: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.FLOWCONTROL_XONXOFF_OUT:
    ^
    .\SerialParameters.java:391: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.FLOWCONTROL_XONXOFF_IN:
    ^
    .\SerialParameters.java:393: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.FLOWCONTROL_RTSCTS_IN:
    ^
    .\SerialParameters.java:395: cannot find symbol
    symbol : variable SerialPort
    location: class SerialParameters
    case SerialPort.FLOWCONTROL_RTSCTS_OUT:
    ^
    52 errors

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    As far as I know javax.comm.*; is not a standard API package in Java. So what you have to do is, download it and added into class path. There should be a download location on the page where you find this code.

    Java API doc is not a download tool. It's the collection of all class details in Java, bunch of web pages.

  5. #5
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    Default thanks

    Dear Erranga,
    can i download this package and add it to the class path please assist me


    This was the link where i found the code but these programs are not working fine can you please tell me how to run them

    I am sorry i am unable to copy the url!!!!!!
    Thanks,
    Raghu
    Last edited by raghu9198; 12-26-2008 at 05:41 PM.

  6. #6
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    Default Java Comm

    It appaers to be an extention of Java:
    COMM API is a Java extension providing access to RS-232 serial ports and IEEE-1284 parallel ports (SPP mode).
    See if this link helps you:
    Java Communications API

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by raghu9198 View Post
    Dear Erranga,
    can i download this package and add it to the class path please assist me


    This was the link where i found the code but these programs are not working fine can you please tell me how to run them

    I am sorry i am unable to copy the url!!!!!!
    Thanks,
    Raghu
    Yes, you cannot add links into the post since you are newbie to the forum. But you can paste text here to see.

    If you download the package you have to add it into the class path. Read the following,

    Setting CLASSPATH on Windows XP

  8. #8
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    Default

    But I have set classpath in my system in environment variables!!!!
    currently i am using jdk-1_5_0 on my system does it make any difference ????????

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •