0

I am getting these two errors. Error: Could not find or load main class Dice Build project error: cannot find symbol

My file is saved as Dice.java. I checked because that was one of my problems with my last program. As far as the symbol error I am not sure.

public class Dice{ <---class is Dice

public static void main(String[] args) {

// Welcome message.
    System.out.println ("Welcome to The Dice Roller Game!");

// Roll the dice.

        int die1, die2;
        int rollcount;
        rollcount = 0;
    int wins = 0;   

Scanner keyboard = new Scanner(System.in); <----line 13 symbol error

This is just a portion of the source code.

Tim
  • 139
  • 2
  • 8

1 Answers1

2

Classes that are not in the java.lang package must be imported to be used:

package com.foo.bar;

import java.util.Scanner;

public class Dice {
    ...

Read more about packages and imports in the Java tutorial.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • Thanks for the help. I am still very new to java so I am still trying to figure out all the terms. – Tim Oct 13 '12 at 22:36