Scanner input error just in Mac?

Discussion in 'Mac Programming' started by Mac Player, Nov 18, 2006.

  1. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #1
    Hi everyone,

    i wrote this piece of code on windows using Eclipse ad it compiled and ran fine:
    , i tried to compile and run this code on my mac, it compiled fine but i cant get it to work, the terminal shows this message:

    I hope someone can help.

    TIA
     
  2. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #2
    It doesn't seem to be able to find anything to read in, have you typed in anything?

    Also what version of Java are you using (check with java -version), Scanner requires Java 1.5 or 1.6
     
  3. iMeowbot macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #3
    Your class seems to work fine here, both from the command line and from within Xcode. What environment are you using to edit and compile your Java stuff? How are you running it?
     
  4. Mac Player thread starter macrumors regular

    Joined:
    Jan 19, 2006
    #4
    I was using Textmate.

    The funny thing is that this code works when compiled through eclipse or XCode.
     
  5. iMeowbot macrumors G3

    iMeowbot

    Joined:
    Aug 30, 2003
    #5
    Oh. Are you launching the compiled .class or .jar from within textmate or something like that? Maybe it simply isn't handing standard input off to to the keyboard. Does it work okay if you instead run it from a Terminal shell prompt?
     
  6. Mac Player thread starter macrumors regular

    Joined:
    Jan 19, 2006
    #6
    Its runs ok in the Terminal. So, i guess Textmate's run window doesnt allow inputs.

    Thanks for all the help.
     

Share This Page