Cannot find symbol on new Book()

hi, i have problem with NetBean error when create program below:
class library{
main(){
Library xxx = new Library();
xxx.fillMe();
private void fillMe(){
libCat = new Cat(10);
// populate Cat
System.out.print("something");
Book book1 = new Book("something2");
libCat.addBook(book1);...
libCat.printCatalogue();
the error:
symbol : constructor Book(java.lang.String,java.lang.String,java.lang.String)
location: class Book
it runderlining with the above error with underline red line, can anyone help please?
thanks
chilli

yeh, i did, i did on the Book.java class:
Book libbook = new Book();
libbook.printDetails();
but error still:
please see:|
xxxxxxxxxxxxxxxxxxxxxxx
init:
deps-jar:
Compiling 1 source file to E:\NetBeans java projects\MyProject06\build\classes
E:\NetBeans java projects\MyProject06\src\Library.java:51: cannot find symbol
symbol : constructor Book(java.lang.String,java.lang.String,int)
location: class Book
Book book1 = new Book("Java Essential , "Cay Horstmann", 2003);
E:\NetBeans java projects\MyProject06\src\Library.java:54: cannot find symbol
symbol : constructor Book(java.lang.String,java.lang.String,int)
location: class Book
Book book2 = new Book("Net Hacking ", "James Bond", 2001);
E:\NetBeans java projects\MyProject06\src\Library.java:57: cannot find symbol
symbol : constructor Book(java.lang.String,java.lang.String,int)
location: class Book
Book book3 = new Book("Internet and Networking Unleashed", "Tom Cruise", 2002);
E:\NetBeans java projects\MyProject06\src\Library.java:60: cannot find symbol
symbol : constructor Book(java.lang.String,java.lang.String,int)
location: class Book
Book book4 = new Book("Windows NT Server 4 Explorer", "Jackie Gibson", 1998);
E:\NetBeans java projects\MyProject06\src\Library.java:64: cannot find symbol
symbol : constructor Book(java.lang.String,java.lang.String,int)
location: class Book
Book book5 = new Book("Upgrade and Build Your Own PC", "Wesley Snipes", 2003);
5 errors
BUILD FAILED (total time: 1 minute 26 seconds)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
thanks in advance

Similar Messages

  • Cannot find symbol - XStream xstream = new XStream();

    Hello everyone! :D I'm currently working on something that can load 'configuration' (some kind of cache) via. XML files.
    To do so I made a instance of the Object class:
        public static Object load(File file)
            try
                InputStream is = new GZIPInputStream(new FileInputStream(file));
                Object rv = xstream.fromXML(is);
                return rv;
            catch (IOException ioe) {
                System.err.println(ioe.getMessage());
            return null;
        }And I have initialized the XStream class like this: private final static XStream xstream = new XStream();And yes I have imported this: import com.thoughtworks.xstream.XStream;But still I get this annoying error...
    I store the xstream.jar in a folder named lib. (Together with some other JAR's like: xpp3, mina, hex-string and such things).
    If you need more of my code just tell me and I'll post.

    I do know that I don't need code but i need to use the javac.exe program. But I don't get a (s)(h)(i)(t) of how I can add my lib folder to the compiler, in a classpath. But here's what my compiler says: DataConversions.java:3: package com.bombaydigital.vault does not exist
    import com.bombaydigital.vault.HexString;
                                  ^
    PersistenceManager.java:6: package com.thoughtworks.xstream does not exist
    import com.thoughtworks.xstream.*;
    ^
    PersistenceManager.java:10: cannot find symbol
    symbol  : class XStream
    location: class org.rscdaemon.client.util.PersistenceManager
        public static XStream xstream = new XStream();
                      ^
    DataConversions.java:279: cannot find symbol
    symbol  : variable HexString
    location: class org.rscdaemon.client.util.DataConversions
            return HexString.bufferToHex(md.digest());
                   ^
    PersistenceManager.java:10: cannot find symbol
    symbol  : class XStream
    location: class org.rscdaemon.client.util.PersistenceManager
        public static XStream xstream = new XStream();
                                            ^
    5 errorsAnd this is the folder where my XStream.jar is located. C:\Documents and Settings\Benjamin Dahse\Client\libAnd this is how I'm compiling: "C:/programmer/Java/jdk1.6.0_10/bin/javac.exe" *.java <-- so far XD.
    I suppose this was the information you required so now please, please, please, make my compiler ;).

  • Help with 'cannot find symbol' error

    Ive written the following code. It is an excerpt from my entire class.
    When I try to compile the code I get the error:-
    cannot find symbol
    Symbol: variable playerRun1
    location: this class
    public void analysePlayerMove()
              if (playerGo == true)
                   if (playerMove.getComponentCount() == 0)
                        JOptionPane.showMessageDialog(this, "You Have Not Made A Move", "Empty Move", JOptionPane.ERROR_MESSAGE);
                   else
                        if (areTherePickUps == false)
                             for (int j=0; j<playerMove.getComponentCount(); j++)
                                  //reversing the players hand, because what is displayed on the GUI is reversed
                                  Component[] playerRun = playerMove.getComponentsInLayer(playerMove.DEFAULT_LAYER);
                                  Component[] playerRun1 = new Component[playerRun.length];
                                  int reverse = playerRun.length-1;
                                  for (int k=0; k<playerRun.length; k++)
                                       playerRun1[k] = playerRun[reverse];
                                       reverse--;
                             if (acePlayed == true && playerRun1.length == 1)
                                  if (playerRun1[0] != acePlayedSuit)
                                       JOptionPane.showMessageDialog(this, "Your Move Is Not Valid", "Invalid Move", JOptionPane.ERROR_MESSAGE);
                                  else
                                       //remove the cards from the players move hand and add them to the bottom of the shredded deck
         }I dont understand why I am getting this error, I clearly define the variable.

    Yes, but the variable is declared inside a block and so it's local to that block. You can't use it outside its scope, which is the block in which you declared it. Re-read the section of your book about variable scope.

  • Help a Beginner? cannot find symbol error?

    class Box {
         double width;
         double height;
         double depth;
    Box(Box ob) {
              width = ob.width;
              height = ob.height;
              depth = ob.depth;
    Box(double w, double h, double d) {
         width = w;
         height = h;
         depth = d;
    double volume() {
         return width * height * depth;
    class BoxWeight extends Box {
         double weight;
         BoxWeight(double w, double h, double d, double m) {
              width = w;
              height = h;
              depth = d;
              weight = m;
    class DemoBoxWeight {
         public static void main(String[] args) {
              BoxWeight mybox1 = new BoxWeight(10, 20, 35, 34);
              double vol;
              vol = mybox1.volume();
              System.out.println("Weight of mybox1 is " + mybox1.weight);
    okay, this is basically from a book, but when I compile it in TextPad, it reads
    C:\Documents and Settings\Guest 1\Desktop\EPGY C015\Box\Box.java:27: cannot find symbol
    symbol : constructor Box()
    location: class Box
         BoxWeight(double w, double h, double d, double m) {
         ^
    1 error
    Tool completed with exit code 1
    Why is that and how can I fix it? :P

    Whenever you extend a class (here you're extending Box with BoxWeight), and create the subclass's constructor, the parent class's (or super class's) constructor gets called first whether it is explicitly called or not. So here in the BoxWeight constructor, the Box constructor is implicitly called:
    BoxWeight(double w, double h, double d, double m) {
      // even though you don't specify it, the Box() constructor is called here. 
      // it's as if you have here the call:
      super();
      width = w;
      height = h;
      depth = d;
      weight = m;
    }If you don't specify the super(), it get's implicitly called as the first call in the BoxWeight constructor. Notice that the implicit constructor has no parameters. Since Box does not have a constructor without parameters, this will throw an error. To get around this, you should explicitly call the super constructor with its proper parameters as the first method called in your BoxWeight constructor:
    BoxWeight(double w, double h, double d, double m) {
      super(w, h, d);  // *** here ***
      width = w;
      height = h;
      depth = d;
      weight = m;
    }

  • Cannot find symbol symbol  : constructor

    I'm a java student, I've recently started constructors and inheritence, I've been pouring over my text book
    all day and I've can't work out what I have done wrong in my code.
    class TestComputer
    {  public static void main (String [ ] args)
         Computer IBM = new Computer ("IBM",286);
          System.out.println(IBM);
    public class Computer extends TestComputer{
              protected String processorModel;
                    protected int clockSpeed;
        public Computer() {
             this.processorModel = processorModel;
             this.clockSpeed = clockSpeed;
        public String toString ()
              String result = "Processor Model: " + processorModel + "\n";
                      result += "Clock Speed: " + clockSpeed + "\n";
              return result;
    }The error I am getting is cannot find symbol constructor Computer(java.lang.String,int)
    and I can't for the life of me work out why.
    Edited by: FallingLeaves on Sep 9, 2008 11:07 PM

    Computer IBM = new Computer ("IBM",286);The error message tells you everything you need to know. The above line is calling a constructor with 2 parameters: String and int. Where in your class is the constructor that takes those 2 parameters?

  • "Cannot find symbol" error problem

    I've got problem with compiling this program:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class SliderDemo extends JFrame {
         private JSlider diameterSlider;
         private ovalPanel myPanel;
         public SliderDemo()
              super( "&#1048;&#1079;&#1084;&#1077;&#1085;&#1077;&#1085;&#1080;&#1077; &#1076;&#1080;&#1072;&#1084;&#1077;&#1090;&#1088;&#1072; &#1082;&#1088;&#1091;&#1075;&#1072;" );
              myPanel = new ovalPanel();
              myPanel.setBackground( Color.YELLOW );
         diameterSlider = new JSlider( SwingConstants.HORIZONTAL, 0, 200, 10 );
         diameterSlider.setMajorTickSpacing( 10 );
         diameterSlider.setPaintTicks( true );
         diameterSlider.addChangeListener(
              new ChangeListener() {
                   public void stateChanged( ChangeEvent e )
                        myPanel.setDiameter( diameterSlider.getValue() );
         Container container = getContentPane();
         container.add( diameterSlider, BorderLayout.SOUTH );
         container.add( myPanel, BorderLayout.CENTER );
         setSize( 220, 270 );
         setVisible( true );
         public static void main( String args[] )
              SliderDemo application = new SliderDemo();
         application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }Compiler shows 2 errors, looking similar:
    SliderDemo.java:12: cannot find symbol
    symbol : class ovalPanel
    location: class SliderDemo
    private ovalPanel myPanel;
    SliderDemo.java:18: cannot find symbol
    symbol : class ovalPanel
    location: class SliderDemo
    myPanel = new ovalPanel();
    What can I do with it. I checked everything on Internet and books, but it still not compiling!

    possible problems are:
    1. you haven't created an ovalPanel() class in your sliderDemo class
    2. you have created an ovalPanel() class in separate file but you didn't save it with the same directory with your sliderDemo class

  • Cannot Find Symbol Error, please help.

    I am brand new to Java, so sorry if this question is obvious, but I keep receiving the following error when i try and compile the following code Circle.java
    Circle.java:17: cannot find symbol
    symbol : constructor Point()
    location: class pointClass.Point
    ^
    Circle.java:18: cannot find symbol
    symbol : method Point(double,double)
    location: class pointClass.Point
    super.Point(x,y); //set center to (x,y)
    ^
    2 errors
    I cant seem to figure out why I am getting this error, any help that anyone could provide would be greatly appreciated.
    This is the code for Circle.java:
    package circleClass;
    import pointClass.*;
    public class Circle extends Point
    private double radius; //Add a double radius field.
    public Circle()
    super(0,0); //call Point?s constructor initializing center to (0,0)
    radius = 0.0; //set radius to 0.0
    public Circle(double x, double y, double r)
    super.Point(x,y); //set center to (x,y)
    radius = r; //set radius to r
    public double r()
    return radius; //returns radius.
    public double getArea()
    return Math.PI*(radius*radius); //returns area of Circle object
    public double getCircumference()
    return 2*Math.PI*radius; //returns circumference of Circle object
    public String toString()
    return "center: ("+x+","+y+")"+"\nradius: "+r; //returns String that will give
    //output of the format...
    //center: (x,y)
    //radius: r
    If it helps, this is the code for pointClass:
    package pointClass;
    public class Point
    private double xcoor,ycoor;
    public static final Point ORIGIN = new Point();
    private Point()
    xcoor = 0;
    ycoor = 0;
    public Point(double x, double y)
    xcoor = x;
    ycoor = y;
    public double x()
    return xcoor;
    public double y()
    return ycoor;
    public String toString()
    return "(" + xcoor + "," + ycoor + ")";
    public static double distance(Point p, Point q)
    double dx = q.xcoor - p.xcoor;
    double dy = q.ycoor - p.ycoor;
    return Math.sqrt(dx*dx + dy*dy);
    Thanks for your help.

    {color:#000080}Both of your classes need to be in the same package, not each one in a package of its own. You have imported pointClass.Pont in Circle.java, but I don't think that's what you want to do. For a better understanding of packages, read{color}
    http://java.sun.com/docs/books/tutorial/java/package/index.html
    And post code like this:
    [code]CODE[/code] is displayed as CODE{color:#000080}db{color}

  • "cannot find symbol" error in compiling

    I'm just begining to learn Java and I have the "Teach yourself Java in 21 Days" book. I can't get the code to work and every time I compile the VolcanoRobot.java, I get this error:
    "VolcanoRobot.java:25: cannot find symbol
    symbol : method showAttributes()
    location: class VolcanoRobot
    dante.showAttributes();
    ^
    VolcanoRobot.java:28: cannot find symbol
    symbol : method showAttributes()
    location: class VolcanoRobot
    dante.showAttributes();
    ^
    VolcanoRobot.java:31: cannot find symbol
    symbol : method showAttributes()
    location: class VolcanoRobot
    dante.showAttributes();
    ^
    VolcanoRobot.java:34: cannot find symbol
    symbol : method showAttributes()
    location: class VolcanoRobot
    dante.showAttributes();
    ^
    4 errors"
    and here is my code:
    "class VolcanoRobot {
    String status;
    int speed;
    float temperature;
    void checkTemperature() {
    if (temperature > 700) {
    status = "returning home";
    speed = 8;
    void showAtrributes() {
    System.out.println("Status: " +status);+
    +System.out.println("Speed: "+ speed);
    System.out.println("Temperature: " + temperature);
    public static void main(String[] arguments) {
    VolcanoRobot dante = new VolcanoRobot();
    dante.status = "exploring";
    dante.speed = 2;
    dante.temperature = 510;
    dante.showAttributes();
    System.out.println("Increasing speed to 3.");
    dante.speed = 3;
    dante.showAttributes();
    System.out.println("Changing temperature to 670.");
    dante.temperature = 670;
    dante.showAttributes();
    System.out.println("Checking the temperature.");
    dante.checkTemperature();
    dante.showAttributes();
    }"

    Use code tags when you post code.
    Post the code that produces the error - the code that you posted does not.
    The code you posted has the following errors
    VolcanoRobot.java:18: ')' expected
                    System.out.println("Status: " status);
                                                 ^
    VolcanoRobot.java:18: illegal start of expression
                    System.out.println("Status: " status);
                                                        ^
    VolcanoRobot.java:19: ')' expected
                    System.out.println("Speed: " speed);
                                                ^
    VolcanoRobot.java:19: illegal start of expression
                    System.out.println("Speed: " speed);Once those errors are fixed you get the errors that you posted.
    VolcanoRobot.java:25: cannot find symbolThe number in that line (25) tells you the exact line where the error appeared. Although sometimes the cause might be a line before that.
    It also tells you specifically what it doesn't like. In this case 'showAttributes'.
    Hint: So look at that line carefully. And look at the method carefully that that is supposed to call. They are not the same.

  • Cannot find symbol error.. really stuck.

    I have a class named Rectangle.java. It is in a package "Geometry" together with Point.java and Line.java. But when I try to use Rectangle.java in my main program, MyRect.java, it gives me a "cannot find symbol" error, particularly the methods and sometimes the variables. I tried compiling just my Rectangle class and it compiled fine.. And I tried the Line and Point classes on another program and it works fine... well probably because the Line and Point classes are from a book(Ivor Horton's Beginning Java 2).. I am just starting out in Java. :)
    Rectangle.java
    package Geometry;
    public class Rectangle{
        public Point[] corner = new Point[4];
        public String name;
        public Rectangle(){
            corner[0].setPoints(0,0);
            corner[1].setPoints(1,0);
            corner[2].setPoints(0,1);
            corner[3].setPoints(1,1);
            name = new String("Unknown");
        public Rectangle(double point1_x,double point1_y,double point2_x, double point2_y, String Name){
            corner[0].setPoints(point1_x, point1_y);
            corner[3].setPoints(point2_x, point2_y);
            corner[1].setPoints(point2_x, point1_y);
            corner[2].setPoints(point1_x, point2_y);
            name = new String(Name);
        public Rectangle(final Rectangle oldRect, String Name){
            corner[0] = oldRect.corner[0];
            corner[3] = oldRect.corner[3];
            corner[1] = oldRect.corner[1];
            corner[2] = oldRect.corner[2];
            name = new String(Name);
        public double getWidth(){
            return corner[0].distance(corner[1]);
        public static void printRectangle(final Rectangle rect){
            for(int i= 0;i<4;i++){
                System.out.println("Corner"+(i+1)+" X: "+rect.corner.getX()+" Corner"+(i+1)+" Y: "+rect.corner[i].getY());
    System.out.println();
    public String toString(){
    return ("Name: "+name);
    }MyRect.java
    import Geometry.*;
    public class MyRect{
        public static void main(String[] args){
            Rectangle myRect = new Rectangle(0,0,2,1);
            Rectangle copyRect = new Rectangle(myRect);
            printRectangle(myRect);
            double width = myRect.getWidth();
    }and the errors:
    MyRect.java:4: cannot find symbol
    symbol  : constructor Rectangle(double,double,double,double,java.lang.String)
    location: class Rectangle
                    Rectangle myRect = new Rectangle(0.0,0.0,2.0,1.0,"My Rectangle")
                                       ^
    MyRect.java:9: cannot find symbol
    symbol  : variable name
    location: class Rectangle
                    System.out.println(myRect.name);
                                             ^
    2 errors

    Are you sure you have posted the whole content of MyRect.java
    import Geometry.*;
    public class MyRect{
        public static void main(String[] args){
            Rectangle myRect = new Rectangle(0,0,2,1);
            Rectangle copyRect = new Rectangle(myRect);
            printRectangle(myRect);
            double width = myRect.getWidth();
    }I don't see the following error line in the code you have given.
    MyRect.java:4: cannot find symbol
    symbol  : constructor Rectangle(double,double,double,double,java.lang.String)
    location: class Rectangle
                    Rectangle myRect = new Rectangle(0.0,0.0,2.0,1.0,"My Rectangle")
                                       ^
    MyRect.java:9: cannot find symbol
    symbol  : variable name
    location: class Rectangle
                    System.out.println(myRect.name);
                                             ^
    2 errors

  • Cannot find symbol error on first program

    Good day
    I just started studying computer programming and the first app in book does not compile and I get error "Cannot find symbol". Error points to last line of code System.out.printf( "Sum is %d\n", sum );
    Code is copied from book so what is wrong?
    Here is full code:
    import java.util.Scanner;
    public class Addition
    public static void main( String args[] )
    Scanner input = new Scanner ( System.in );
    int number1;
    int number2;
    int sum;
    System.out.print( "Enter first integer: ");
    number1 = input.nextInt();
    System.out.print( "Enter second integer: ");
    number2 = input.nextInt();
    sum = number1 + number2;
    System.out.printf( "Sum is %d\n", sum );
    Thank you

    If the OP were compiling with an older Java version,
    the error would occur at the first line, not
    the last; Scanner was also introduced in Java 5.
    Anyway, that code compiles and runs fine on my
    computer.Damn, didn't see the usage of Scanner.

  • [help] cannot find symbol

    I'm trying to work on lessons from a book called Java Server Faces. Only problem is there seems to be a java file i cannot compile. Maybe someone here can see whats up?
    here is the error i get when i run javac TableData.java
    TableData.java:4: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    private static final Name[] names = new Name[] {
                         ^
    TableData.java:11: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    public Name[] getNames() { return names;}
           ^
    TableData.java:4: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    private static final Name[] names = new Name[] {
                                            ^
    TableData.java:5: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("William", "Dupont"),
        ^
    TableData.java:6: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("Anna", "Keeney"),
        ^
    TableData.java:7: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("Mariko", "Randor"),
        ^
    TableData.java:8: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("John", "Wilson")here is the code
    package com.corejsf;
    public class TableData {
    private static final Name[] names = new Name[] {
    new Name("William", "Dupont"),
    new Name("Anna", "Keeney"),
    new Name("Mariko", "Randor"),
    new Name("John", "Wilson")
    public Name[] getNames() { return names;}
    }I believe i have all my jar files properly located in webapps/xxx/web-inf/lib
    but i could be wrong..
    thanks

    If its a sample application from some place they should have provide it. Otherwise if the Name class usage is simple you can create the class file yourself.
    Subsequently you can create you own jar file for this using the
    jar cvf [jar file name].jar [package folders]\*.class
    and place it in WEB-INF/lib

  • 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...

  • 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"?

  • 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

  • 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

Maybe you are looking for