Results 1 to 6 of 6
  1. #1
    petrohamadi is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default Error: ConsoleProgram cannot be resolved to the type

    Hello,
    I'm getting the error "ConsoleProgram cannot be resolved to the type" on eclipse IDE, I've got no idea of what to do, Please help me if you can, it's a very small program as shown bellow

    import acm.program.*;
    public class HelloWorld extends ConsoleProgram {
    public void run(){
    println("Hello World");
    }
    }

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default

    What is ConsoleProgram which HelloWorld extends? Is this a defined class in the same package as HelloWorld or in the imported package? Is the package acm.program.* on the classpath?

  3. #3
    petrohamadi is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    yeah HelloWorld extends ConsoleProgram and they not in the same package, helloworld is located in the default package the project and acm library was added on build path as "add external archives"

  4. #4
    petrohamadi is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    any other idea my friend?

  5. #5
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default

    Make sure the library is added to the classpath correctly ('add external archives' does not sound correct). Right click the project and go to properties->Java Build Path -> Libraries -> Add External Jar

  6. #6
    petrohamadi is offline Member
    Join Date
    Jun 2011
    Posts
    4
    Rep Power
    0

    Default

    I've done this: Right click the project and go to properties->Java Build Path -> Libraries -> Add External Jar but still not working. I don't understand why a very small program give me such bad times. please anyone else with more ideas.

Similar Threads

  1. HttpServlet Cannot be resolved to a type
    By chizbox in forum Eclipse
    Replies: 3
    Last Post: 07-01-2012, 05:09 PM
  2. Replies: 1
    Last Post: 03-11-2011, 08:37 AM
  3. Replies: 4
    Last Post: 12-13-2010, 10:00 PM
  4. Filter cannot be resolved to a type??
    By Harrie_KalaChakra in forum Eclipse
    Replies: 1
    Last Post: 01-15-2010, 09:19 AM
  5. Replies: 1
    Last Post: 12-18-2007, 10:41 AM

Posting Permissions

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