Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

NoSuchMethodError java

Options
  • 23-11-2003 11:33pm
    #1
    Closed Accounts Posts: 1,325 ✭✭✭


    Hey people,

    I've been working away on a java project in linux. Everything has been compiling and running fine until I tried to compile and run it in windows.

    In windows, when I try to use the .split method on a string it gives me the errror java.lang.NoSuchMethodError. (loadsa other stuff)

    can anyone please tell me why it's saying the above??

    String result[] = text.split("\n");

    Is it having problems with the \n?????

    A.


Comments

  • Closed Accounts Posts: 24 colonelx


    hi,

    It would be best to give us some more info,
    (ie) versions of java that u are using ? both on the Linux box and Windows box

    and have you recompilled all the code under windows ? before trying to run it ?
    AFAIK if java files compilled under a specific version, and then run (executed) on a different version of java sometimes throw up weird errors.

    --Colonelx


  • Closed Accounts Posts: 1,325 ✭✭✭b3t4


    Thanks colonelx it was the versions that was wrong.

    The version of java that I was compiling it on in windows is 1.2.1 and the version I had written it for is 1.4.2.

    Tried compiling it and running it on updated windows machine and it worked fine. I just paniced :-) ever so relieved now.

    Thanks again,
    A.


  • Registered Users Posts: 6,310 ✭✭✭OfflerCrocGod


    Yep .split is since 1.4 so it's possible that the windows one you are using is 1.3 or earlier??. Get the latest SDK from the Sun site and run it on that and see what happens. If that doesn't work give us the rest of the error.

    <edit>
    Crap I replied just as you posted your thanks:p I'm a bit slowww) .
    </edit>


  • Closed Accounts Posts: 358 ✭✭CH


    if you're writing for cross platform, u might want to use...

    [php]
    String newLine = System.getProperty("line.separator");
    String result[] = text.split(newLine);
    [/php]
    getProperty


Advertisement