Results 1 to 6 of 6

Thread: Need help getting Scanner to work in Eclipse/Java-1.5-Sun

  1. #1
    Join Date
    Dec 2004
    Location
    Atlanta, GA, US
    Beans
    102
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Angry Need help getting Scanner to work in Eclipse/Java-1.5-Sun

    I really need the ability to use the Scanner library in Eclipse. I've been trying to make it work for about a month now with no luck. It's how my Java teacher is making us handle input, so I can't use any other methods. Apparently Scanner was added with Java 1.5, yet Eclipse is built to work with Java 1.4 in Ubuntu. I've followed this guide to fix that, but I still can't get it to recognize it. I've even tried it under both Dapper and Edgy too. I know Scanner works fine in Windows (what my teacher unfortunately uses), but I reeaaalllly, don't want to have to do it that way.

    Any ideas? Please....
    Thanks!
    ...

  2. #2
    Join Date
    Feb 2006
    Beans
    223
    Distro
    Kubuntu Karmic Koala (testing)

    Re: Need help getting Scanner to work in Eclipse/Java-1.5-Sun

    Did you change the java library in eclipse to point to 1.5?

    George

  3. #3
    Join Date
    Dec 2004
    Location
    Atlanta, GA, US
    Beans
    102
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Need help getting Scanner to work in Eclipse/Java-1.5-Sun

    Yes
    ...

  4. #4
    Join Date
    Feb 2006
    Beans
    223
    Distro
    Kubuntu Karmic Koala (testing)

    Re: Need help getting Scanner to work in Eclipse/Java-1.5-Sun

    So if you open up the terminal and type java -version

    you should get output similar to

    java version "1.5.0_08"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
    Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_08-b03, mixed mode)

    George

  5. #5
    Join Date
    Sep 2005
    Beans
    122

    Re: Need help getting Scanner to work in Eclipse/Java-1.5-Sun

    From the main menu go Project->Propeties
    with the treeview on the left select Java Compiler
    On the right is your Compiler compliance level set to 5.0?

  6. #6
    Join Date
    Dec 2004
    Location
    Atlanta, GA, US
    Beans
    102
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Need help getting Scanner to work in Eclipse/Java-1.5-Sun

    To answer both of the questions above, yes....

    I ended up just having to download the binary from the Eclipse site, and now it works fine. I've also found that it's much faster since it's compiled against the actual Sun JRE instead of GCJ
    ...

Bookmarks

Posting Permissions

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