Cannot find symbol and streams

I am making some progress with implimenting the icaste jar file to control the serial port. My code is below. I have a problem with the statement osOut.write(bData,0,0); at the bottom of the code. cannot find symbol
I am trying to write one byte to the serial port, I don't understand the use of the outputStream being used here from java.io , If I knew how the access worked on a lower level perhaps I could figure it out.
In an AVR microcontroller for example, you set up the hardware on the chip to output a byte you place in a buffer, when there is data to read you have an interrupt set to jump to an isr routine that receives a byte and puts it in your own memory space or array. The hardware has a buffer it uses to hold some number of bytes and error flags to find out if you have a buffer overrun.
Not sure if that concept is what is going on here or not.
import com.icaste.JCommSerial.*;
import java.io.*;
public class newtest {
     * @param args
    public static void main(String[] args) {
        byte[] baData = new byte[1];
        baData[0]= (byte)255;
        String Errorstring = "None";
        System.out.println("Testing Serial port");
        SerialPort myPort = new SerialPort();
        try {
            myPort.openPort("COM1:", 2000, 2000);
        } catch(SerialPortNotFoundException e) {
            Errorstring="Serial port not Found";
        } catch(SerialPortInUseException e) {
            Errorstring="Serial port in use";
        } catch(SerialPortException e) {
            Errorstring="Serial port unable to complete operation";
        } catch(Throwable e) {
            Errorstring="unknown error";
        try {
            myPort.setBaudRate(9600);
        } catch(SerialPortException e) {
            Errorstring="Unable to set baud rate";
        try {
            myPort.setDataBits((byte)8);
        } catch(SerialPortException e) {
            Errorstring="Unable to set data bits";
        try {
            myPort.setStopBits(SerialPort.ONESTOPBIT);
        } catch(SerialPortException e) {
            Errorstring="Unable to set stop bit";
        try {
            myPort.setParityMode(SerialPort.NOPARITY);
        } catch(SerialPortException e) {
            Errorstring="Unable to set parity";
        try {
            OutputStream osOut = myPort.getOutputStream();
        } catch(IOException e) {
        try {
            osOut.write(baData, 0, 0);
        } catch(IOException e) {
            Errorstring="write byte failed";
        System.out.println("Error = "+Errorstring);
   

Ok, I can finally put this question to bed. My main error was not knowing what the line of code actually was. After 4 hours of reading http://www.yu.edu/faculty/arosnfld/java/javanotes-3.1/c5/s3.html and a nice email from the tech at icaste, I finally understand what is going on and what it all means.
If you would like to see what I am up too you can check out the DMX light prototype moveie I made a few weeka ago. It is using a program called freescale and a DMX controller connected to a USB port. The serial port can be configured to operate a USB port from windows point of view and that is my next quest to study how a USB port connection works on the hardware side.
Thanks for the help and links, I wish there was more time in the day, and night to cram all this stuff in my head.
Quicktime Movie (kind of big) http://www.acousticlights.com/ledmovie.m1v
import com.icaste.JCommSerial.*;
import java.io.*;
public class newtest {
     * @param args
    public static void main(String[] args) {
        SerialPort myPort = new SerialPort();
        String Errorstring = "None";
        System.out.println("Testing Serial port ");
        try {
            myPort.openPort("COM1:", 2000, 2000);
        } catch(SerialPortNotFoundException e) {
            Errorstring="Serial port not Found";
        } catch(SerialPortInUseException e) {
            Errorstring="Serial port in use";
        } catch(SerialPortException e) {
            Errorstring="Serial port unable to complete operation";
        } catch(Throwable e) {
            Errorstring="unknown error";
        try {
            myPort.setBaudRate(9600);
        } catch(SerialPortException e) {
            Errorstring="Unable to set baud rate";
        try {
            myPort.setDataBits((byte)8);
        } catch(SerialPortException e) {
            Errorstring="Unable to set data bits";
        try {
            myPort.setStopBits(SerialPort.ONESTOPBIT);
        } catch(SerialPortException e) {
            Errorstring="Unable to set stop bit";
        try {
            myPort.setParityMode(SerialPort.NOPARITY);
        } catch(SerialPortException e) {
            Errorstring="Unable to set parity";
        try {
//Get an OutputStream from JCommSerial and reference it by the name osOut.
//assuming you already created a JCommSerial object called spPort
// and opened it!
            OutputStream osOut = myPort.getOutputStream();
//Write your byte to the port
// the write() function takes an int that is then converted
// to a byte for transmission.
            int iData = 255;
// Send 254 bytes of data to the serial port
            while (iData >0) {
                osOut.write(iData);
                iData--;             
        } catch(Exception e){
            System.out.println(e.toString());
        System.out.println("Error = "+Errorstring);
}

Similar Messages

  • Cannot find symbols and characters table in Excel.

    Hi, could you please help me with finding symbols ( arrow up and down etc.) and characters in Excel. I tried all menues but couldn't find them.
    Thank you in advance.

    Is that what you are talking about?
    To display the outline symbols, on the Excel menu, click Preferences, and then click View. Select the Outline symbols check box.

  • Java Studio Enterprise 8.1 and jdk1.6 - cannot find symbol

    Hi,
    I am using subj. The problem I have is that I declared 2-3 classes with methods in one package. I made an object of the class and use intellisense to navigate to the method I need but when I try to compile the code I have "cannot find symbol" error on the method I intellisensed to. It seems to me that it is IDE problem.
    Does anyone know how to work around it?
    The code is below, in case you are interested.
    package webservice;
    import java.io.*;
    public class Main {
    /** Creates a new instance of Main */
    public Main() {
    * @param args the command line arguments
    public static void main(String[] args) {
    String filename = null;
    String timestamp = null;
    try {
    Q q = new Q();
    timestamp = "2007-06-01";
    QList ql = q.getList(timestamp);
    System.out.println("--------------Ok-------------");
    catch(Exception e) {
    System.out.println("An Exception thrown in Main(). e = "+e.toString());
    package webservice;
    public class Q {
    public Q() {
    public QList getList(String timestamp) {
    QList result = null;
    return result;
    Thanks,
    Dmitry

    Thanks for that Kris.
    I found the root of my problem. In this example I used a remote webservice to retrieve some data. It happened to be that the generated class file from wsdl and my custom class had the same name.
    So, instead of reporting as ambiguous definition error the ide picked up the wrong class and did not find the method I intended to use.
    Hopefully it will help someone else having the same problem.
    Dmitry

  • Need help with class info and cannot find symbol error.

    I having problems with a cannot find symbol error. I cant seem to figure it out.
    I have about 12 of them in a program I am trying to do. I was wondering if anyone could help me out?
    Here is some code I am working on:
    // This will test the invoice class application.
    // This program involves a hardware store's invoice.
    //import java.util.*;
    public class InvoiceTest
         public static void main( String args[] )
         Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
    // display invoice1
         System.out.println("Original invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    // change invoice1's data
         invoice1.setPartNumber( "001234" );
         invoice1.setPartDescription( "Yellow Hammer" );
         invoice1.setQuantity( 3 );
         invoice1.setPricePerItem( 19.49 );
    // display invoice1 with new data
         System.out.println("Updated invoice information" );
         System.out.println("Part number: ", invoice1.getPartNumber() );
         System.out.println("Description: ", invoice1.getPartDescription() );
         System.out.println("Quantity: ", invoice1.getQuantity() );
         System.out.println("Price: ", invoice1.getPricePerItem() );
         System.out.println("Invoice amount: ", invoice1.getInvoiceAmount() );
    and that uses this class file:
    public class Invoice
    private String partNumber;
    private String partDescription;
    private int quantityPurchased;
    private double pricePerItem;
         public Invoice( String ID, String desc, int purchased, double price )
              partNumber = ID;
         partDescription = desc;
         if ( purchased >= 0 )
         quantityPurchased = purchased;
         if ( price > 0 )
         pricePerItem = price;
    public double getInvoiceAmount()
         return quantityPurchased * pricePerItem;
    public void setPartNumber( String newNumber )
         partNumber = newNumber;
         System.out.println(partDescription+" has changed to part "+newNumber);
    public String getPartNumber()
         return partNumber;
    public void setDescription( String newDescription )
         System.out.printf("%s now refers to %s, not %s.\n",
    partNumber, newDescription, partDescription);
         partDescription = newDescription;
    public String getDescription()
         return partDescription;
    public void setPricePerItem( double newPrice )
         if ( newPrice > 0 )
    pricePerItem = newPrice;
    public double getPricePerItem()
    return pricePerItem;
    Any tips for helping me out?

    System.out.println("Part number:
    "+invoice1.getPartNumber;
    The + sign will concatenate invoice1.getPartNumber()
    after "Part number: " forming only one String.I added the plus sign and it gives me more errors:
    C:\>javac InvoiceTest.java
    InvoiceTest.java:16: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ",   + invoice1.getPartNumber() );
                                                  ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:17: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:18: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:19: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:20: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    InvoiceTest.java:24: cannot find symbol
    symbol  : method setPartDescription(java.lang.String)
    location: class Invoice
            invoice1.setPartDescription( "Yellow Hammer" );
                    ^
    InvoiceTest.java:25: cannot find symbol
    symbol  : method setQuantity(int)
    location: class Invoice
            invoice1.setQuantity( 3 );
                    ^
    InvoiceTest.java:30: operator + cannot be applied to java.lang.String
            System.out.println("Part number: ", + invoice1.getPartNumber() );
                                                ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method getPartDescription()
    location: class Invoice
            System.out.println("Description: ", + invoice1.getPartDescription() );
                                                          ^
    InvoiceTest.java:31: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Description: ", + invoice1.getPartDescription() );
                      ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method getQuantity()
    location: class Invoice
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                                                       ^
    InvoiceTest.java:32: cannot find symbol
    symbol  : method println(java.lang.String,int)
    location: class java.io.PrintStream
            System.out.println("Quantity: ", + invoice1.getQuantity() );
                      ^
    InvoiceTest.java:33: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Price: ", + invoice1.getPricePerItem() );
                      ^
    InvoiceTest.java:34: cannot find symbol
    symbol  : method println(java.lang.String,double)
    location: class java.io.PrintStream
            System.out.println("Invoice amount: ", + invoice1.getInvoiceAmount() );
                      ^
    16 errors

  • Cannot find symbol:constructor

    here is my code...
    package org.tiling.didyoumean;
    import java.io.IOException;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.BufferedReader;
    import org.apache.lucene.index.Term;
    import org.apache.lucene.queryParser.ParseException;
    import org.apache.lucene.search.Query;
    import org.apache.lucene.search.TermQuery;
    import org.apache.lucene.search.spell.SpellChecker;
    import org.apache.lucene.store.Directory;
    import org.apache.lucene.store.FSDirectory;
    import org.apache.commons.cli.ParseException;
    public class spell {
         public static void main(String args[]){
              System.out.println("hi");
         String spellIndex = "C://opt//lucene//didyoumean//indexes//spell";
         SpellChecker spellChecker = new SpellChecker(spellIndex);
         String[] similarWords = spellChecker.suggestSimilar("jva", 1);
         System.out.println(similarWords[0]);
    }and the error i am kept getting is
    C:\Documents and Settings\sumit-i\Desktop\didyoumean\didyoumean-1.0\src\java>javac org/tiling/didyoumean/spell.java
    org\tiling\didyoumean\spell.java:29: cannot find symbol
    symbol  : constructor SpellChecker(java.lang.String)
    location: class org.apache.lucene.search.spell.SpellChecker
            SpellChecker spellChecker = new SpellChecker(spellIndex);
                                        ^
    1 errorany ideas..plzz

    here is the Directory.java,....please help me if you can....actually i have a deadline to submit this..but i am not getting this...
    package org.apache.lucene.store;
    * Licensed to the Apache Software Foundation (ASF) under one or more
    * contributor license agreements.  See the NOTICE file distributed with
    * this work for additional information regarding copyright ownership.
    * The ASF licenses this file to You under the Apache License, Version 2.0
    * (the "License"); you may not use this file except in compliance with
    * the License.  You may obtain a copy of the License at
    *     http://www.apache.org/licenses/LICENSE-2.0
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    import java.io.IOException;
    /** A Directory is a flat list of files.  Files may be written once, when they
    * are created.  Once a file is created it may only be opened for read, or
    * deleted.  Random access is permitted both when reading and writing.
    * <p> Java's i/o APIs not used directly, but rather all i/o is
    * through this API.  This permits things such as: <ul>
    * <li> implementation of RAM-based indices;
    * <li> implementation indices stored in a database, via JDBC;
    * <li> implementation of an index as a single file;
    * </ul>
    * Directory locking is implemented by an instance of {@link
    * LockFactory}, and can be changed for each Directory
    * instance using {@link #setLockFactory}.
    * @author Doug Cutting
    public abstract class Directory {
      /** Holds the LockFactory instance (implements locking for
       * this Directory instance). */
      protected LockFactory lockFactory;
      /** Returns an array of strings, one for each file in the
       * directory.  This method may return null (for example for
       * {@link FSDirectory} if the underlying directory doesn't
       * exist in the filesystem or there are permissions
       * problems).*/
      public abstract String[] list()
           throws IOException;
      /** Returns true iff a file with the given name exists. */
      public abstract boolean fileExists(String name)
           throws IOException;
      /** Returns the time the named file was last modified. */
      public abstract long fileModified(String name)
           throws IOException;
      /** Set the modified time of an existing file to now. */
      public abstract void touchFile(String name)
           throws IOException;
      /** Removes an existing file in the directory. */
      public abstract void deleteFile(String name)
           throws IOException;
      /** Renames an existing file in the directory.
       * If a file already exists with the new name, then it is replaced.
       * This replacement is not guaranteed to be atomic.
       * @deprecated
      public abstract void renameFile(String from, String to)
           throws IOException;
      /** Returns the length of a file in the directory. */
      public abstract long fileLength(String name)
           throws IOException;
      /** Creates a new, empty file in the directory with the given name.
          Returns a stream writing this file. */
      public abstract IndexOutput createOutput(String name) throws IOException;
      /** Returns a stream reading an existing file. */
      public abstract IndexInput openInput(String name)
        throws IOException;
      /** Returns a stream reading an existing file, with the
       * specified read buffer size.  The particular Directory
       * implementation may ignore the buffer size.  Currently
       * the only Directory implementations that respect this
       * parameter are {@link FSDirectory} and {@link
       * org.apache.lucene.index.CompoundFileReader}.
      public IndexInput openInput(String name, int bufferSize) throws IOException {
        return openInput(name);
      /** Construct a {@link Lock}.
       * @param name the name of the lock file
      public Lock makeLock(String name) {
          return lockFactory.makeLock(name);
       * Attempt to clear (forcefully unlock and remove) the
       * specified lock.  Only call this at a time when you are
       * certain this lock is no longer in use.
       * @param name name of the lock to be cleared.
      public void clearLock(String name) throws IOException {
        if (lockFactory != null) {
          lockFactory.clearLock(name);
      /** Closes the store. */
      public abstract void close()
           throws IOException;
       * Set the LockFactory that this Directory instance should
       * use for its locking implementation.  Each * instance of
       * LockFactory should only be used for one directory (ie,
       * do not share a single instance across multiple
       * Directories).
       * @param lockFactory instance of {@link LockFactory}.
      public void setLockFactory(LockFactory lockFactory) {
          this.lockFactory = lockFactory;
          lockFactory.setLockPrefix(this.getLockID());
       * Get the LockFactory that this Directory instance is
       * using for its locking implementation.  Note that this
       * may be null for Directory implementations that provide
       * their own locking implementation.
      public LockFactory getLockFactory() {
          return this.lockFactory;
       * Return a string identifier that uniquely differentiates
       * this Directory instance from other Directory instances.
       * This ID should be the same if two Directory instances
       * (even in different JVMs and/or on different machines)
       * are considered "the same index".  This is how locking
       * "scopes" to the right index.
      public String getLockID() {
          return this.toString();
       * Copy contents of a directory src to a directory dest.
       * If a file in src already exists in dest then the
       * one in dest will be blindly overwritten.
       * @param src source directory
       * @param dest destination directory
       * @param closeDirSrc if <code>true</code>, call {@link #close()} method on source directory
       * @throws IOException
      public static void copy(Directory src, Directory dest, boolean closeDirSrc) throws IOException {
          final String[] files = src.list();
          if (files == null)
            throw new IOException("cannot read directory " + src + ": list() returned null");
          byte[] buf = new byte[BufferedIndexOutput.BUFFER_SIZE];
          for (int i = 0; i < files.length; i++) {
            IndexOutput os = null;
            IndexInput is = null;
            try {
              // create file in dest directory
              os = dest.createOutput(files);
    // read current file
    is = src.openInput(files[i]);
    // and copy to dest directory
    long len = is.length();
    long readCount = 0;
    while (readCount < len) {
    int toRead = readCount + BufferedIndexOutput.BUFFER_SIZE > len ? (int)(len - readCount) : BufferedIndexOutput.BUFFER_SIZE;
    is.readBytes(buf, 0, toRead);
    os.writeBytes(buf, toRead);
    readCount += toRead;
    } finally {
    // graceful cleanup
    try {
    if (os != null)
    os.close();
    } finally {
    if (is != null)
    is.close();
    if(closeDirSrc)
    src.close();
    please let me know....if you any idea about it..
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Xerces cannot find symbol problem

    In my program I get an Xml from an exist database and want to place it in the hard drive.
    I have made the xerces imports I need:
    import org.apache.xerces.domx.XGrammarWriter.OutputFormat;
    import org.apache.xml.serialize.XMLSerializer;I have the jar on my classpath.and the code I am getting trouble with is:
    OutputFormat format = new OutputFormat(doc2);
                        format.setIndenting(true);
                        XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlCopy.xml")), format);I get the following errors
    C:\.....\Wizard1.java:2946: cannot find symbol
    symbol  : constructor OutputFormat(org.w3c.dom.Document)
    location: class org.apache.xerces.domx.XGrammarWriter.OutputFormat
                        OutputFormat format = new OutputFormat(doc2);
    C:\.....\Wizard1.java:2947: cannot find symbol
    symbol  : method setIndenting(boolean)
    location: class org.apache.xerces.domx.XGrammarWriter.OutputFormat
                        format.setIndenting(true);
    C:\....\Wizard1.java:2948: cannot find symbol
    symbol  : constructor XMLSerializer(java.io.FileOutputStream,org.apache.xerces.domx.XGrammarWriter.OutputFormat)
    location: class org.apache.xml.serialize.XMLSerializer
                        XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File("C:\\Configuration\\XmlCopy.xml")), format);Any ideas about what I'm doing wrong?

    StruL wrote:
    Instead of GrammarWriter.OutPutFormat.class it says GrammarWriter$OutPutFormat.class.
    relevant or plain stupid?
    Neither really,
    GrammarWriter.OutPutFormat is the name of the class,
    GrammarWriter$OutPutFormat.class is the file into which the class is stored.
    As to you problem the error messages you posted referred to
    C:\.....\Wizard1.java:2946: cannot find symbol
    symbol  : constructor OutputFormat(org.w3c.dom.Document)
    location: class org.apache.xerces.domx.XGrammarWriter.OutputFormatnote dom*x* and XGrammarWriter ,
    this is not the same as dom.GrammarWriter...

  • HT201317 I have a PC with Windows Vista but I cannot find my photo stream anywhere. I followed the directions on the FAQ but it led me nowhere. What do I do?

    I have a PC with Windows Vista but I cannot find my photo stream anywhere. I followed the directions on the FAQ but it led me nowhere. What do I do?

    Well I linked to an article produced and hosted by Apple so I suppose if they have an issue with it the would have to spank themselves
    In addition the US Supreme Court has ruled that making a copy of a DVD for personal use or as a backup is perfectly legal, we've been doing that with CDs for as long as it has been possible, same for video tapes.
    What is illegal is breaking any DRM protection on the media (this holds true for all media not just DVDs) and actually even this is a bit murky. What is definitely illegal is to sell software to break DRM.  However if you write your own DRM breaking software and use it to make personal copies or backups the law gets real gray.
    So again as long as there is no DRM involved its OK, with DRM you're best to leave it alone.
    regards

  • Error in importing user-created jar file & cannot find symbol

    Hello.
    I try to import the jar file made from common classes in the previous project. by using NB 5.5.1.
    The jar file is named as 'tpslib.jar'
    The previoud package name is 'tps'.
    I added tpslib.jar in the library, and removed the class files from the orginal project, because the class files exist in the tpslib.jar.
    THe jar file has 8 class files inclduing the following class, ReservationData.
    My question is why the follwoing fuction call try to the method in the previous package, tps instead of those of tpslib.jar.
    If you have anyone to answer me, it will be very appreciated.
    Tae
    package tps;
    import java.sql.*;
    import java.util.*;
    import java.io.*;
    import tpslib.*;
    public class tpsPWSImpl implements tpsPWSSEI {
    public ReservationData reserve(ReservationData request) throws java.rmi.RemoteException {
    request.print();
    requestLocal.print();
    if (!request.equalsCoreOf(requestLocal)){
    cFlag = true;
    System.out.println("reserve: WARNING ");
    ===================
    9 Error Messages
    ====================
    cannot find symbol
    symbol : method print()
    location: class tps.ReservationData
    request.print();
    cannot find symbol
    symbol : constructor ReservationData(tps.ReservationData)
    location: class tps.ReservationData
    wr = new ReservationData(rr);
    ===========

    Does your jar include:
    /a/Main.classWith class Main defined in package, er, "a"?

  • Issue with - "cannot find symbol - variable JOptionPane"

    need some help, got the below loop and want it to be able to loop by the number input by the input dialog. when i compile it i get an error in BlueJ. the error is "cannot find symbol - variable JOptionPane". Any help. have tried a few things however cannot get this to work at all. any suggestions?
    public void numberLoop()
    String qA = JOptionPane.showInputDialog(null,"How many times should this be completed (e.g. 1,2,3,4)?","Question",JOptionPane.QUESTION_MESSAGE);
    int qA2 = Integer.parseInt(qA);
    for (int startNum = 1; startNum <= qA2; startNum++)
    System.out.println(startNum + " squared is " + (startNum * startNum));
    }

    never mind i fixed it. forgot the below.
    import javax.swing.JOptionPane;
    LOL

  • Newbie question: cannot find symbol symbol: class STRING

    I've just decided to teach myself some java, and on my first try something's going wrong and I don't know what it is.
    I'm currently doing this tutorial: http://java.sun.com/docs/books/tutorial/uiswing/learn/example1.html
    and everything is good until I try to compile it and I get this error in the cmd
    HelloWorldSwing.java:30: cannot find symbol
    cannot find symbol
    symbol: class STRING
    everything has been written verbatim from the tutorial, including "import javax.swing.*;"
    What's wrong with it and how do I fix it?

    Hi,
    I saw the coding that You had given a link in your post. Change the following
        public static void main(String[] args) {bye for now
    sat

  • Cannot find symbol class

    I am having a "Cannot find symbol" problem. My Java is a bit rusty so I'm not exactly sure what it could be. I have two classes, City and SisterCities. The SisterCities references the City class. The City class compiles fine. Both classes are part of the same package. However, when I compile SisterCities, I get the error. Could you please tell me how to get the second class to recognize the first (import, extends, not really sure. I've tried alot) Here are those two classes so far...
    ****** City ********
    package hw01;
    public class City
         public final String name;
         public final String country;
         public final City [] sisters;
    public City (String name, String country)
              // throw new RuntimeException ("Not implemented yet.");
              this.name = name;
              this.country = country;
              this.sisters = new City [0];
    public City (String name, String country, City [] sisters)
              // throw new RuntimeException ("Not implemented yet.");
              this.name = name;
              this.country = country;
              this.sisters = new City [sisters.length];
              for (int i = 0; i < sisters.length; i++) {
                   this.sisters[i] = sisters;
    public void setSisters (City [] sisters)
              // throw new RuntimeException ("Not implemented yet.");
              for (int i = 0; i < sisters.length; i++) {
                   this.sisters[i] = sisters[i];
    public String getName ()
              // throw new RuntimeException ("Not implemented yet.");
              return this.name;
    public String getCountry ()
              // throw new RuntimeException ("Not implemented yet.");
              return this.country;
    public City [] getSisters ()
              // throw new RuntimeException ("Not implemented yet.");
              return this.sisters;
    ******** SisterCities *********
    package hw01;
    import java.util.LinkedList;
    public class SisterCities
         public final LinkedList cityList;
    public SisterCities ()
              // throw new RuntimeException ("Not implemented yet.");
    public void addCity (City city)
              // throw new RuntimeException ("Not implemented yet.");
              this.cityList.add(city);
    public int getNumCities ()
              // throw new RuntimeException ("Not implemented yet.");
    public City getCity (int i)
              // throw new RuntimeException ("Not implemented yet.");

    final attribute members like "cityList" must be initialised when they're declared or inside the constructors
    if you want to compile, you'll also have to uncomment the "throws" in your methods (or return a value)
    (pay attention to the error messages the compiler gives you and paste them all when posting questions)

  • Cannot find symbol class ParseException

    I have this in my code how ever
    DateFormat formatter = new SimpleDateFormat("ddMMyyyy");
    dDateStamp = (Date)formatter.parse(dateStamp);
    When I pass in say
    dateStamp=safsadssad sa;
    I get an error which is fine.
    I can not seem to catch this error with try catch
    When I use the one below it says it cannot find the symbol
    When i use the Exception it still throws and error to jsp page
    cannot find symbol
    symbol : class ParseException
    }catch(ParseException e){   
    symbol : class ParseException
    }catch(ParseException e){   
    Any One know I csn trap this?
    Thanks in advance

    Well, it's in the j2se API. Not sure what to tell you...

  • Cannot find symbol class Scanner

    hi all
    i'm defining a class within a project so i can use the class inside my program, but the line:
    Scanner keyboard = new Scanner(System.in);generates an error with my compiler:
    cannot find symbol class Scanner
    please help

    you aren't using jdk 5 or higher then. that's when scanner was added to the jdk.
    download a modern jdk and you'll be fine.
    %

  • Cannot find symbol : class ! problem

    Hello,
    I have 2 java files (CD.java & CDCatalog.java) in a package called "testPackage". I can compile CD.java, but CDCatalog.java (that creates CD instances) gives following error - cannot find symbol symbol : class CD
    Below are the 2 files, please tell me why I get this errors , thanks!
    1) CDCatalog.java
    package testPackages;
    import java.util.Hashtable;
    //import testPackages.CD;
    public class CDCatalog {
    /** The CDs, by title */
    private Hashtable catalog;
    public CDCatalog( ) {
    catalog = new Hashtable( );
    // Seed the catalog
    addCD(new CD("Nickel Creek", "Nickel Creek", "Sugar Hill"));
    addCD(new CD("Let it Fall", "Sean Watkins", "Sugar Hill"));
    addCD(new CD("Aerial Boundaries", "Michael Hedges", "Windham Hill"));
    addCD(new CD("Taproot", "Michael Hedges", "Windham Hill"));
    public void addCD(CD cd) {
    if (cd == null) {
    throw new IllegalArgumentException("The CD object cannot be null.");
    catalog.put(cd.getTitle( ), cd);
    2) CD.java
    package testPackages;
    public class CD {
    private String title;
    private String artist;
    private String label;
    public CD( ) {
    // Default constructor
    public CD(String title, String artist, String label) {
    this.title = title;
    this.artist = artist;
    this.label = label;
    public String getTitle( ) {
    return title;
    public void setTitle(String title) {
    this.title = title;
    public String getArtist( ) {
    return artist;
    public void setArtist(String artist) {
    this.artist = artist;
    public String getLabel( ) {
    return label;
    public void setLabel(String label) {
    this.label = label;
    public String toString( ) {
    return "'" + title + "' by " + artist + ", on " +
    label;
    }

    just tried it as well, no problems, provided you
    compile CD.java firstI just tried from the shell ans look at this...
    E:\testPackages>dir
    Volume in drive E is MYFLASHDISK
    Volume Serial Number is 483B-B160
    Directory of E:\testPackages
    05/24/2006  07:48 PM    <DIR>          .
    05/24/2006  07:48 PM    <DIR>          ..
    05/24/2006  07:20 PM             1,143 CD.java
    05/24/2006  07:50 PM             1,053 CD.class
    05/24/2006  07:56 PM               972 CDCatalog.java
                   3 File(s)          3,168 bytes
                   2 Dir(s)   1,024,503,808 bytes free
    E:\testPackages>javac -cp e:\testPackages CDCatalog.java
    CDCatalog.java:30: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
        public void addCD(CD cd) {
                          ^
    CDCatalog.java:24: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Nickel Creek", "Nickel Creek", "Sugar Hill"));
                      ^
    CDCatalog.java:25: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Let it Fall", "Sean Watkins", "Sugar Hill"));
                      ^
    CDCatalog.java:26: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Aerial Boundaries", "Michael Hedges", "Windham Hill"));
                      ^
    CDCatalog.java:27: cannot find symbol
    symbol  : class CD
    location: class testPackages.CDCatalog
            addCD(new CD("Taproot", "Michael Hedges", "Windham Hill"));
                      ^
    5 errors
    E:\testPackages>I am now officially confused. I even specified the exact path to the CD.class file and javac still didnt like it.
    I'll dig some more. It has to be related to the classpath some how..
    JJ
    Still Stumped.. I'll sleep on it..
    Message was edited by:
    Java_Jay

  • Cannot find Symbol :class CLOB

    Hi,
    I am using JDK1.5.0_06 and Oracle8.1.7.
    When i compile java program I am getting the following error
    cannot find symbol
    symbol : class CLOB
    I have added classes12.zip into classpath.
    Can anybody tell me why this errpr comes? Is there any other files instead of classes12.zip to be added (since its JDK1.5 version? )
    Thanks in advance
    neema

    you have mentioned about the class "studentList" but that class is not to be found in the code you have pasted. its instead "ListTest". And the "menu" function seems to b a part of "ListTest" class. Can you provide the structure of the classes "studentList" and "Student" so that the problem can be more clearly understood?
    also you are using the variable "Stdin" in the line int choice = Stdin.readInteger(); where as you have not declared this variable.
    in the "switch" statement you are calling two different functions for the same case "3" where as it should be "case 3" and "case 4" respectively.
    in the "main" you are calling the "menu" function without any parameter while you actually want to pass argument of type "studentList".

Maybe you are looking for