Javac = "cannot find symbol" when compiling class referencing other classes

I have several Java files in a directory which is declared as a package at the start of the files
package filemanager;
This program works perfectly in an IDE, however I'm having problems with compiling in command line.
I have set the classpath as I understand to be right for my computer to:
C:\Program Files\Java\jdk1.6.0_02\bin
I can compile a class that references no other classes in this package/directory.
However files which reference other classes bring up such errors:
javac AllFiles.javaAllFiles.java:174: cannot find symbol
symbol : variable Bob
location : class filesmanager.AllFiles
Bob.getItem(itemRef);
Where Bob is an example of another class. Even though I can say, compile Bob on it's own as it doesnt have any such reference.
I've tried:
javac -cp "C:\Program Files\Java\jdk1.6.0_02\bin" AllFiles.javaThis also failed.
Any ideas?
Edited by: ajr87 on Feb 8, 2008 10:26 AM

I've tried spoon_'s suggestion, but I'm still getting the error ("cannot find symbol"). Here is my code:
File Hello/Fred.java:
package Hello;
public class Fred
    public int age;
    public Fred()
        this.age = 1;
} // public class FredFile Hello/Hello.java:
package Hello;
public class Hello
    public static void main(String args[])
        Fred fred = new Fred();
        System.out.println("Fred is " + fred.age);
} // public class HelloAnd here is my attempt to compile Fred.java and Hello.java:
C:/Users/levner/programs[219]javac -cp c:\users\levner\programs\hello Hello\Fred.java
C:/Users/levner/programs[220]javac -cp c:\users\levner\programs\hello Hello\Hello.java
Hello\Hello.java:14: cannot find symbol
symbol  : class Fred
location: class Hello.Hello
        Fred fred = new Fred();
        ^
Hello\Hello.java:14: cannot find symbol
symbol  : class Fred
location: class Hello.Hello
        Fred fred = new Fred();
                        ^
2 errorsI am doing this work on a PC running Vista using javac 1.6.0_10. I've tried various combinations of upper and lower case names for the package and file names, and I always get the same errors.
Thanks in advance for your help. David

Similar Messages

  • "cannot resolve symbol" when compiling a class that calls methods

    I am currently taking a Intro to Java class. This problem has my instructor baffled. If I have two classes saved in separate files, for example:
    one class might contain the constructor with get and set statements,
    the other class contains the main() method and calls the constructor.
    The first file compiles clean. When I compile the second file, I get the "cannot resolve symbol error" referring to the first class.
    If I copy both files to floppy and take them to school. I can compile and run them with no problem.
    If I copy the constructor file to the second file and delete the "public" from the class declaration of the constructor, it will compile and run at home.
    At home, I am running Windows ME. At school, Windows 2000 Professional.
    The textbook that we are using came with a CD from which I downloaded the SDK and Runtime Environment. I have tried uninstalling and reinstalling. I have also tried downloading directly from the Sun website and still the error persists.
    I came across a new twist tonight. I copied class files from the CD to my hard drive. 4 separate files. 3 of which are called by the 4th.
    I can run these with no problem.
    Any ideas, why I would have compile errors????
    Thanks!!

    Oooops ... violated....
    Well first a constructor should have the same name as the class name so in our case what we have actually created is a static method statementOfPhilosophy() in class SetUpSite and not a constructor.
    Now why does second class report unresolved symbol ???
    Look at this line
    Class XYZ=new XYZ();
    sounds familiar, well this is what is missing from your second class, since there is no object how can it call a method ...
    why the precompiled classes run is cuz they contain the right code perhaps so my suggestion to you is,
    1) Review the meaning and implementation of Constructors
    2) Ask your instructor to do the same ( no pun intended ... )
    3) Check out this for understanding PATH & CLASSPATH http://www.geocities.com/gaurav007_2000/java/
    4) Look at the "import" statement, when we have code in different files and we need to incorporate some code in another it is always a good idea to use import statement, that solves quite a few errors.
    5) Finally forgive any goof up on this reply, I have looked at source code after 12 months of hibernation post dot com doom ... so m a bit rusty... shall get better soon though :)
    warm regards and good wishes,
    Gaurav
    CW :-> Mother of all computer languages.
    I HAM ( Radio-Active )
    * OS has no significance in this error
    ** uninstalling and reinstalling ? r u nuttttttts ??? don't ever do that again unless your compiler fails to start, as long as it is giving a valid error it is working man ... all we need to do is to interpret the error and try to fix the code not the machine or compiler.

  • Compiler error: "cannot find symbol" - constructor

    Dear all,
    I keep getting the compiler error "cannot find symbol" - constructor AWTEvent() for the following class. It's supposed to extend AWTEvent to give me my own event to be fired. What could be wrong?
    import java.awt.*;
    import java.awt.event.*;
    public class MyButtonEvent extends AWTEvent
         public MyButtonEvent()
    }Thanks a lot!
    N

    When you do this
    public MyButtonEvent()
    }you are implicitly calling the super class constructor with no parameters
    That is:
    AWTEvent();
    you can think of it as
    public MyButtonEvent()
         AWTEvent(); // <-- automatically generated for you
         //the rest of your stuff
    }the problem is that AWTEvent has no such constructor, so you need to explicitly put another constructor in your constructor as the first statement. This other constructor has to be one that exists in AWTEvent.

  • Help - cannot find symbol error

    Can someone help me? I am getting "cannot find symbol" error in my code and cannot figure out why. Here is my code:
    public class toyInventory
    private String[] toyInventory = {"ball", "bat", "bear", "car", "doll", "game", "glove", "playstation", "train"};
    private int[] nineArray = {0,0,0,0,0,0,0,0};
    int invItems = 0;
    public void countToy()
    String orderInput[] = {"bear", "train", "car", "ball", "doll", "ball", "train", "doll", "game", "train", "bear", "doll", "train", "car", "ball", "bat", "glove", "bat", "b", "doll", "bear", "ball", "doll", "bat", "car", "glove", "train", "doll", "bear"};
    int noMatch;
    for(int a = 0; a < orderInput.length; a++)
    noMatch = 0;
    for(int b = 0; b < toyInventory.length; b++)
    if(orderInput[a] == toyInventory)
    noMatch = 1;
    break;
    if(noMatch == 0)
    invItems = 1;
    public void printItems()
    for(int c = 0; c < toyInventory.length; c++)
    if (countToy[c] > 4)<-------- cannot find symbol error here
    System.out.print("*");
    System.out.print(toyInventory[c] + "\t" + countToy[c] + "\n"); <----cannot find symbol error here also
    System.out.print("The number of invalid items in the order is" + invItems);
    public static void main( String[] args)
    toyInventory collection = new toyInventory ();
    collection.countToy();
    collection.printItems();

    public void countToy()
    String orderInput[] = {"bear", "train", "car", "ball", "doll", "ball", "train", "doll", "game", "train", "bear", "doll", "train", "car", "ball", "bat", "glove", "bat", "b", "doll", "bear", "ball", "doll", "bat", "car", "glove", "train", "doll", "bear"};In the above code you have declared countToy() as method and while in the below lines you are calling countToy[] as an array. So please check that...
    if (countToy[c] > 4)<-------- cannot find symbol error here
    System.out.print("*");
    System.out.print(toyInventory[c] + "\t" + countToy[c] + "\n"); <----cannot find symbol error here also
    }

  • Error: cannot find symbol method Text

    Hi
    I want to make an index for txt files by using Lucene, it got an error: cannot find symbol method Text. what is it about? Does it mean the Text is not in Field?
    thank you v much
    pls look into my code:
    package TestLucene;
    import java.io.File;
    import java.io.FileReader;
    import java.io.Reader;
    import java.util.Date;
    import org.apache.lucene.analysis.Analyzer;
    import org.apache.lucene.analysis.standard.StandardAnalyzer;
    import org.apache.lucene.document.Document;
    import org.apache.lucene.document.Field;
    import org.apache.lucene.index.IndexWriter;
    import org.apache.lucene.document.Fieldable;
    import java.io.Serializable;
    * This class demonstrate the process of creating index with Lucene
    * for text files
    public class Lucene {
         public static void main(String[] args) throws Exception{
              //indexDir is the directory that hosts Lucene's index files
            File   indexDir = new File("D:\\luceneIndex");
            //dataDir is the directory that hosts the text files that to be indexed
            File   dataDir  = new File("D:\\luceneData");
            Analyzer luceneAnalyzer = new StandardAnalyzer();
            File[] dataFiles  = dataDir.listFiles();
            IndexWriter indexWriter = new IndexWriter(indexDir,luceneAnalyzer,true);
            long startTime = new Date().getTime();
            for(int i = 0; i < dataFiles.length; i++){
                 if(dataFiles.isFile() && dataFiles[i].getName().endsWith(".txt")){
              System.out.println("Indexing file " + dataFiles[i].getCanonicalPath());
              Document document = new Document();
              Reader txtReader = new FileReader(dataFiles[i]);
              document.add(Field.Text("path",dataFiles[i].getCanonicalPath()));
              document.add(Field.Text("contents",txtReader));
              indexWriter.addDocument(document);
    indexWriter.optimize();
    indexWriter.close();
    long endTime = new Date().getTime();
    System.out.println("It takes " + (endTime - startTime)
    + " milliseconds to create index for the files in directory "
              + dataDir.getPath());

    Hal-.- wrote:
    I downloaded Lucene from its homepage, I have tried Lucene 2.3.0 and Lucene 2.2.0, but same errors occurs which is cannot find symbol method Text.
    I checked class Field under Lucene, it doesn't have Text function. Well there you go. You can't call methods that don't exist.
    What should I do to add two Fields "path" & "contents" into Document?It seems very likely that the object that represents an indexed document, has some way to express the concepts of "path" and "contents". You should probably just read the docs some more.
    But other than that I have no idea. Ask on a Lucene forum.

  • Cannot find symbol error when compiling in different packages

    Hey all,
    I'm trying to divide my project into a sensible hierarchy. This is what I want:
    MyProject
    MyProject/src ................................. where all the source files are (no further directories)
    MyProject/classes
    MyProject/classes/Main.class
    MyProject/classes/classes2 ................ sorry for not being creative XD
    MyProject/classes/classes2/Age.classNow, Age uses Main, and this is where the trouble is. I'm using javac directly to compile Age, and this is how I'm doing it:
    //from MyProject
    javac -cp classes src/Age.javaAnd I get this error:
    bla bla bla...cannot find symbol
    symbol  : variable Main
    location: class classes2.Age
              years = (byte)(Main.year - m.getYear());
                             ^Main is already compiled and in place.
    Also, this is how Age.java starts:
    package classes2;
    public class Age
    {...etcI'm using JCreator as an IDE (and using it's own build function, the same error occurs, which is why I tried directly compiling the file).
    Why can't javac find Main.class? I tried searching Google, but my particular problem didn't seem to crop up.
    Hope I provided enough information, and ask if more is needed.
    Many thanks :)

    If Main is not in a package (which it appears not to be), then it cannot be referenced by any class that is in a package. If Main is in a package, then you'll need to refer to it by it's fully-qualified name (or import it as such) if it's not in the same package as the class that's referring to it, and Main.class will have to be in a directory that corresponds to its package.
    Also, though the compiler may not require it, your source code directory structure should match your package hierarchy.

  • Cannot find symbol error when compiling from cmd

    When compile and running program from Eclipse 3.3 everything works fine, but when trying to compile from cmd I get this error:
    C:\TEMP\1>javac A.java
    A.java:38: cannot find symbol
    symbol : class SwingWorker
    location: package javax.swing
    import javax.swing.SwingWorker;
    ^
    A.java:48: cannot find symbol
    symbol : class SwingWorker
    location: class A
    class Task extends SwingWorker {
    ^
    A.java:109: cannot find symbol
    symbol : method addPropertyChangeListener(A)
    location: class A.Task
    task.addPropertyChangeListener(this);
    ^
    A.java:110: cannot find symbol
    symbol : method execute()
    location: class A.Task
    task.execute();
    ^
    java -version get back: java version "1.6.0_14"....
    now, if i copy .class file that Eclipse made and just execute thet .class file from cmd everything works fine.
    here is the code, but i think that problems is somwhere else. i tried to serach on google, but... :(
    import java.awt.BorderLayout;
    import java.awt.Cursor;
    import java.awt.Insets;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.SwingWorker;
    public class A extends JPanel implements ActionListener, PropertyChangeListener {
        private JProgressBar progressBar;
        private JButton startButton;
        private JTextArea taskOutput;
        private Task task;
        class Task extends SwingWorker {
             * Main task. Executed in background thread.
    //        @Override
            public Void doInBackground() {
                 System.out.println("test");
                return null;
             * Executed in event dispatching thread
    //        @Override
            public void done() {
                Toolkit.getDefaultToolkit().beep();
                startButton.setEnabled(true);
                setCursor(null); //turn off the wait cursor
                taskOutput.append("Done!\n");
        public A() {
            super(new BorderLayout());
            //Create the demo's UI.
            startButton = new JButton("Start");
            startButton.setActionCommand("start");
            startButton.addActionListener(this);
            progressBar = new JProgressBar(0, 100);
            progressBar.setValue(0);
            progressBar.setStringPainted(true);
            taskOutput = new JTextArea(25, 50);
            taskOutput.setMargin(new Insets(5,5,5,5));
            taskOutput.setEditable(false);
            JPanel panel = new JPanel();
            panel.add(startButton);
            panel.add(progressBar);
            add(panel, BorderLayout.PAGE_START);
            add(new JScrollPane(taskOutput), BorderLayout.CENTER);
            setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
         * Invoked when the user presses the start button.
        public void actionPerformed(ActionEvent evt) {
            startButton.setEnabled(false);
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            //Instances of javax.swing.SwingWorker are not reusuable, so
            //we create new instances as needed.
            task = new Task();
            task.addPropertyChangeListener(this);
            task.execute();
         * Invoked when task's progress property changes.
        public void propertyChange(PropertyChangeEvent evt) {
            if ("progress" == evt.getPropertyName()) {
                int progress = (Integer) evt.getNewValue();
                progressBar.setValue(progress);
    //            taskOutput.append(String.format("Completed %d%% of task.\n", task.getProgress()));
         * Create the GUI and show it. As with all GUI code, this must run
         * on the event-dispatching thread.
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("Veritas Backup");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            JComponent newContentPane = new A();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
             javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }thank you very much!!!!

    Perhaps you are running an older version of javac. What do you get with "javac -version" or try compiling with the full path to jdk 1.6.0_14/bin/javac.

  • Compile error : Cannot find symbol

    hello, i'm having trouble compiling a bean that resorts to another bean's public operation. Im trying to make a shopping cart which takes individual item orders such as item name and quantity and place them within an array list called cart in another bean. The errors i get when im trying to compile is:
    cannot find symbol
    symbol : class OrderItem
    location: class beans.WidgetOrder
               public void setItem(OrderItem o){cart.add(o);}I've looked at other threads and heard that quicktime can intervein with the classpath, so i deleted that, and also checked that CLASSPATH is set to C:\Program Files\Java\jre1.6.0_04\lib\ext\QTJava which it is, but the javabeans are set in the same path so i don't know what difference that is.

    Are you using an IDE?
    Is the OrderItem class in the beans package?
    You should have a path structure like some/path/beans where the WidgetOrder.class file will reside inside the beans directory. If OrderItem is in the beans package, then when you compile you should use something like "javac -cp some/path WidgetOrder.java"

  • "cannot find symbol" error while compiling the RMI

    I am trying to implement a simple RMI.
    I have the following :
    1. HelloInterface which has the SayHello method defined.
    2. HelloImpl which has the implementation of Say Hello
    3. Server code
    4. Client code
    the HelloInterface compiles properly.
    but when i say javac HelloImpl
    package rmisample;
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.RemoteException;
    public class HelloImpl extends UnicastRemoteObject implements HelloInterface{ --> this is where i get the error
    /** Creates a new instance of HelloImpl */
    public HelloImpl()throws RemoteException {
    super();
    public String SayHello(String s) throws RemoteException
    return "hello" +s;
    I get the following error:
    C:\Myjava\RMISample\src\rmisample>javac HelloImpl.java
    HelloImpl.java:18: cannot find symbol
    symbol: class HelloInterface
    public class HelloImpl extends UnicastRemoteObject implements HelloInterface{
    All 4 files are in the same directory.
    Am not sure what is going wrong and am new to this.
    Edited by: topcatin on Sep 14, 2007 6:52 AM

    The problem is probably that the compiler can't find the file with that class definition.
    Try changing your javac call so that is starts off
    javac -classpath .
    The dot is important!
    If it works, then go read up on classpaths.

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

    .\ListGraph.java:26: cannot find symbol
    symbol : class Entry
    location: class Map
    for(Map.Entry<Stad,List<ListEdge>> me : nodes.entrySet())
    ^
    1 error
    this is what i get when i try to compile this code, its the lowest part thats getting errors:
    import java.util.*;
    import java.util.Map.*;
    import java.util.Map.Entry;
    class ListGraph{
         private HashMap<Stad,List<ListEdge>> nodes =
              new HashMap<Stad,List<ListEdge>>();
         public void addNode(Stad ny){
              nodes.put(ny, new ArrayList<ListEdge>());
         public void connect(Stad from, Stad to, String n, int v){
              List<ListEdge> fromList = nodes.get(from);
              List<ListEdge> toList = nodes.get(to);
              ListEdge e1 = new ListEdge(to, n, v);
              fromList.add(e1);
              ListEdge e2 = new ListEdge(from, n, v);
              toList.add(e2);
         public String toString(){
              String ret = "";
              for(Map.Entry<Stad,List<ListEdge>> me : nodes.entrySet())
                   ret += me.getKey()+": "+me.getValue()+"\n";
              return ret;
    }

    Bananen123 wrote:
    .\ListGraph.java:26: cannot find symbol
    symbol : class Entry
    location: class MapI don't get the same error, so I'm not sure what code you are actually trying to compile. Do you happen to have defined another class named Map in the default package?
    Also, please use code tags when posting code. Example: import java.util.*;
    import java.util.Map.*;
    import java.util.Map.Entry;
    class ListGraph{
        private HashMap<Stad,List<ListEdge>> nodes =
            new HashMap<Stad,List<ListEdge>>();
        public void addNode(Stad ny){
            nodes.put(ny, new ArrayList<ListEdge>());
        public void connect(Stad from, Stad to, String n, int v){
            List<ListEdge> fromList = nodes.get(from);
            List<ListEdge> toList = nodes.get(to);
            ListEdge e1 = new ListEdge(to, n, v);
            fromList.add(e1);
            ListEdge e2 = new ListEdge(from, n, v);
            toList.add(e2);
        public String toString(){
            String ret = "";
            for(Map.Entry<Stad,List<ListEdge>> me : nodes.entrySet())
                ret += me.getKey()+": "+me.getValue()+"\n";
            return ret;
    class Stad {}
    class ListEdge{ ListEdge(Stad s, String str, int i) {} }~

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

  • Java Error : cannot find symbol , symbol : class (jdk 1.6.0)

    Dear All,
    Please help me.
    I am running javac from a .bat file and i set the classpath in the bat file as follows.
    echo on
    :start
    set classpath = "C:\Program Files\Java\jdk1.6.0\bin;"
    set classpath = "C:\Program Files\Java\jdk1.6.0\jre\..\lib\tools.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\i18n.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0\jre\classes;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\ldapsec.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\mysql-connector-java-5.0.0-beta-bin.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\sunjce_provider.jar; C:\Program Files\Java\jdk1.6.0\ideset\system;C:\Program Files\Java\jdk1.6.0\ideset\system;C:\Program Files\Java\jdk1.6.0\studio\system;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\j2ee-1.3.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\jaas-1.0.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\autoload\activation.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\jms-1.0.2b.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\jta-spec1_0_1.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\autoload\mail.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\AbsoluteLayout.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\sql.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\rowset.jar;C:\Program Files\Java\jdk1.6.0\studio\lib\ext\jdbc20x.zip;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\servlet-2.3.jar;C:\Program Files\Java\jdk1.6.0\studio\beans\TimerBean.jar;c:\Program Files\Java\jdk1.6.0\ideset\tomcat401_base;C:\sms\com\;"
    cd C:\sms
    javac mainP.java
    pause
    i have few class files which are inherited to the main program using ' import com.Connection; '
    i am getting errors like
    mainP.java:482: cannot find symbol
    symbol : class Connection
    location: class mainP
    Connection connection = new Connection(ipAddress, port);
    I think it is because of some classpath error.
    please advice me.......
    Viju

    Actually, you have NO CLUE what he's trying to doActually he said what he is trying to do in his posting. It's no mystery. But that's all the information that's available. If you know something that isn't posted here why not say so?
    Your reply was a snide, rude, "You're stupid for doing it that way" answerMy reply was neither snide nor rude and implied none of what you impute to it. It was a proper and constructive suggestion. You are entitled to disagree with it, but that doesn't justify this immoderate outburst.
    Bottom line is, you chose to be nastyBottom line is you're just making this up. You are imputing motives to me without evidence. Don't do that.
    You are the type of person that makes searching forums and posting questions for assistance a near waste of time.I doubt that you'll find many regulars here that would agree with that assertion. When you have made over 16,000 posts here over ten years as I have, come back and we'll discuss it some more.
    Go back to grade school and ...I suggest you try it yourself. You're not adding anything except noise to the discussion. Try curbing your temper, and while you're at it have a good look at the Code of Conduct for these forums. You're verging on personal abuse here.
    And, additionally, I've used ANT in the past. Batch files are FAR AND AWAY easier to set up.In your opinion. I disagree entirely, and I have eleven years' experience with Java to back it up.
    As for CLASSPATH, I haven't done anything about setting it beyond installing the JDK since about 1999, and it has a dot in it as we speak.

Maybe you are looking for

  • HP 2000 Laptop won't power on

    I have an HP 2000 that won't power up. When you press the power button, the light on the wireless/F12 button comes on, the the light on the caps lock button comes on and blinks serveral times. after that, the system shuts down. Tried removing the bat

  • Use standard Function kyes as custom in PF ststus

    Hi all, I want to use standard Function kyes(such as F1 & F3) as custom in PF ststus so that I will perform my code by these function keys. Is it possible. Thanks Sanket sethi

  • Concepts: cumulative / non-cumulative key figures. Differences.

    Hi, could you help me to understand cumulative / non-cumulative key figures concepts ? When use it? Differences? Performance? I appreciate you if you spend few rows without link to massive web documentation. Thanks in advance! Bye! Ferdinando

  • Why is Apple mouse so limited?

    Coming from a PC, I find the Apple mouse really really annoying and limited. How the **** do I scroll up and down without a scroll wheel? Come on guys, this is 2014. Are you intentionally ******* people off? Do I have to go out and buy a 3rd party mo

  • Cannot submit datapipe for urb 0, error -28: not enough bandwidth

    cannot submit datapipe for urb 0, error -28: not enough bandwidth What is causing this? I read something about disabling the following: :[ ] Enforce USB bandwidth allocation (EXPERIMENTAL) :[ ] Dynamic USB minor allocation (EXPERIMENTAL) But I feel t