Results 1 to 2 of 2
  1. #1
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    7

    Default The import java.util.Scanner cannot be resolved

    Hi,
    I'm trying to change the version of Java that's running. When I do: update-alternatives --config java

    I get:

    There are 5 alternatives which provide `java'.

    1 /usr/bin/jamvm
    2 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
    3 /usr/bin/gij-wrapper-4.1
    + 4 /usr/lib/jvm/java-gcj/jre/bin/java
    * 5 /usr/lib/jvm/java-6-sun/jre/bin/java



    When I try to compile a program with javac, I get:

    The import java.util.Scanner cannot be resolved and Scanner cannot be resolved to a type

    Any ideas?

  2. #2
    Ed
    Ed is offline Senior Member
    Join Date
    Jun 2007
    Posts
    110
    Rep Power
    0

    Default

    I had a similar problem and I resolved it doing :

    sudo update-alternatives --config javac

    and choosing the version that matches the JRE solves the problem.

Similar Threads

  1. error with import java.io.*
    By osval in forum New To Java
    Replies: 5
    Last Post: 05-13-2010, 05:03 PM
  2. java.util
    By Java Tutorial in forum Java Tutorial
    Replies: 1
    Last Post: 02-07-2008, 01:46 PM
  3. Replies: 0
    Last Post: 11-20-2007, 04:59 PM
  4. Using ava.util.Scanner
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-20-2007, 04:47 PM
  5. java.util.DateFormat not found in import
    By christina in forum New To Java
    Replies: 2
    Last Post: 08-05-2007, 10:31 PM

Posting Permissions

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