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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

NoSuchMethodError java

  • 23-11-2003 10: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, Registered Users 2 Posts: 6,334 ✭✭✭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