Installed JDK C:\Program Files\Java\jdk1.6.0_12
Set Environment Variables
As exercise I created 2 classes in given directory
C:\Program Files\Java\jdk1.6.0_12\bin\Labs\SL110\exercises\getstarted
Shirt.java
=====================================
public class Shirt {
public int shirtID = 0; // Default ID for the shirt
public
String description = "-description required-"; // default
// The color codes are R=Red, B=Blue, G=Green, U=Unset
public char colorCode = 'U';
public double price = 0.0; // Default price for all shirts
public int quantityInStock = 0; // Default quantity for all shirts
// This method displays the values for an item
public void displayShirtInformation() {
System.out.println("Shirt ID: " + shirtID);
System.out.println("Shirt description:" + description);
System.out.println("Color Code: " + colorCode);
System.out.println("Shirt price: " + price);
System.out.println("Quantity in stock: " + quantityInStock);
} // end of display method
} // end of class
Other class where my main is
ShirtTest.java
import java.Shirt.*;
public class ShirtTest {
public static void main (String args[]) {
Shirt myShirt;
myShirt = new Shirt();
myShirt.displayShirtInformation();
}
}
Now, from CMD prompt try to run both classes
running Shirt.java compile fine and perfect no errors and create Shirt.class
after that compiling ShirtTest.java which give me errors as given below:
ShirtTest.java:4: cannot resolve symbol
symbol : class Shirt
location: class ShirtTest
Shirt myShirt;
^
ShirtTest.java:5: cannot resolve symbol
symbol : class Shirt
location: class ShirtTest
myShirt = new Shirt();
^
Attaching Screeshot for more details
Also, I tried all possible solutions in FAQ, google as well other forums
and this is part of sun training program fundamentals one.