Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    8
    Rep Power
    0

    Question cannot find symbol symbol : class Item location: package platypos.services.order

    Well, I am having a few problems getting this java file to compile.


    /home/brandon/Desktop/platypos/services/order/Seat.java
    Java Code:
    package platypos.services.order;
    
    import platypos.services.order.Item;
    import java.util.Vector;
    
    public class Seat
    
    {
    
        private int             _number;
    
        private Vector<Item>    _items  = new Vector<Item>();
        
        public static void main(String args[])
        {
            System.out.println("Hello");
        }
    }
    here is my terminal session:
    Java Code:
    brandon@Aspire5100:~$ javac /home/brandon/Desktop/platypos/services/order/Seat.java
    /home/brandon/Desktop/platypos/services/order/Seat.java:17: cannot find symbol
    symbol  : class Item
    location: package platypos.services.order
    import platypos.services.order.Item;
                                  ^
    /home/brandon/Desktop/platypos/services/order/Seat.java:23: cannot find symbol
    symbol  : class Item
    location: class platypos.services.order.Seat
        private Vector<Item>    _items  = new Vector<Item>();
                       ^
    /home/brandon/Desktop/platypos/services/order/Seat.java:23: cannot find symbol
    symbol  : class Item
    location: class platypos.services.order.Seat
        private Vector<Item>    _items  = new Vector<Item>();
                                                     ^
    3 errors
    /home/brandon/Desktop/platypos/services/order/Item.java is packaged as follows
    Java Code:
    package platypos.services.order;
    and has been successfully compiled to Item.class in the same directory.

    I am using the latest JDK on Ubuntu 8.04
    I am a bit more skilled in C++ and am trying to learn java, anyone got any clues as to what I am doing wrong?

    Thank you

  2. #2
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    7

    Default

    check to make sure all the paths are correct
    My IP address is 127.0.0.1

  3. #3
    Join Date
    May 2008
    Posts
    8
    Rep Power
    0

    Default

    I've checked and double checked, and frankly I am perplexed.

  4. #4
    Join Date
    May 2008
    Posts
    8
    Rep Power
    0

    Default

    javac -cp /home/brandon/Desktop /home/brandon/Desktop/platypos/services/order/Seat.java

    that worked for me, that classpath thing is a pain : )

Similar Threads

  1. Programm Error: cannot find symbol Help?
    By junix in forum New To Java
    Replies: 2
    Last Post: 12-10-2007, 05:30 AM
  2. cannot find symbol class error
    By po0oker in forum New To Java
    Replies: 5
    Last Post: 10-31-2007, 02:52 PM
  3. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:39 AM
  4. Error: cannot find symbol
    By cachi in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 08:12 PM
  5. Error: cannot find symbol constructor
    By zoe in forum New To Java
    Replies: 1
    Last Post: 07-24-2007, 08:24 PM

Posting Permissions

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