Advertisement

04.26.2008 at 08:18AM PDT, ID: 23355897
[x]
Attachment Details

Eclipse: Could not find the main class. Program will exit.

Asked by panJames in Java Programming Language

Tags: Java

Hello experts :-)

Just started to learn Java from "Sams teach yourself Java 6 in 21 days".

There is an example there:

import org.cadenhead.ecommerce.*;

public class GiftShop {
      public static void main(String [] args) {
            Storefront store = new Storefront();
            store.addItem("C01", "MUG", "9.99", "150");
            store.addItem("C02", "LG MUG", "12.99", "82");
            store.addItem("C03", "MOUSEPAD", "10.49", "800");
            store.addItem("D01", "T SHIRT", "16.99", "90");
            store.sort();
                   
            for (int i = 0; i < store.getSize(); i++) {
                  Item show = (Item)store.getItem(i);
                  System.out.println("\nItem ID: " + show.getId() +
                              "\nName: " + show.getName() +
                              "\nRetail Price: $" + show.getRetail() +
                              "\nPrice: $" + show.getPrice() +
                              "\nQuantity: " + show.getQuantity());
            }
      }
}

To compile it using Eclipse I created project Storefront and a folder structure for a package, please have a look at attached file.

I try to run it as an application and get an error message:

"Could not find the main class. Program will exit."

What do I do wrong?

Thank u :-)



Start Free Trial
Attachments:
 
my eclipse problem
my eclipse problem
 
[+][-]04.26.2008 at 08:25AM PDT, ID: 21445811

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 08:30AM PDT, ID: 21445829

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 08:46AM PDT, ID: 21445866

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.26.2008 at 09:13AM PDT, ID: 21445959

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 09:20AM PDT, ID: 21445979

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 09:33AM PDT, ID: 21446020

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 09:44AM PDT, ID: 21446053

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.26.2008 at 09:49AM PDT, ID: 21446064

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 12:29PM PDT, ID: 21446611

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Tags: Java
Sign Up Now!
Solution Provided By: mbodewes
Participating Experts: 4
Solution Grade: B
 
 
[+][-]04.26.2008 at 12:30PM PDT, ID: 21446612

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 01:49PM PDT, ID: 21446798

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.26.2008 at 02:20PM PDT, ID: 21446858

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 03:41PM PDT, ID: 21447022

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628