BlueJ: cannot resolve symbol - class Scanner

Discussion in 'Mac Programming' started by TurboLag, Oct 15, 2004.

  1. macrumors member

    Joined:
    Feb 24, 2004
    #1
    Im trying to compile a simple program in BlueJ 2.01 and I get this error: cannot resolve symbol - class Scanner

    //Program:
    import java.util.Scanner;
    import java.text.NumberFormat;

    public class Deli
    {
    public static void main (String[] args)
    {
    final double OUNCES_PER_POUND = 16.0;

    double pricePerPound;
    double weightOunces;
    double weight;
    double totalPrice;

    Scanner scan = new Scanner(System.in);

    and so on...


    Am I missing a library package?
     
  2. macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #2
    Isn't Scanner a JDK 1.5 thing? Apple haven't made that version of the JDK available to the general public yet.
     
  3. thread starter macrumors member

    Joined:
    Feb 24, 2004
    #3
    How could I implement this program with the currenct JDK?
     
  4. macrumors 601

    stoid

    Joined:
    Feb 17, 2002
    Location:
    So long, and thanks for all the fish!
    #4
    Code:
    try{
        BufferedReader kbr = new BufferedReader( new InputStreamReader( System.in) );
        String userInput = kbr.readLine();
        //process userInput
    } catch {(IOException e) {
        System.out.println("IO Error: " + e );
    }
     

Share This Page