Results 1 to 1 of 1

Thread: Source works in NetBeans but not with java/javac

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2001
    Posts
    574

    Source works in NetBeans but not with java/javac

    Hello,

    I have created a program and it seems to work in NetBeans. Now I am trying to compile it with the commandline compiler. I can get it to compile with:

    Code:
    javac Main.java
    It gives no error and makes a class.

    Now I run the program with:

    Code:
    java -classpath . Main
    It then seems to be running. It asks for input. If I give the same input in the running NetBeans as in the commandline version then it always works in the NetBeans version and in the commandline version I get strange errors.
    It is often an ArrayIndexOutOfBounds on the following line:

    Code:
                     s = subResultaat2.split("øø")[1];
    But the same thing does work in NetBeans. Anyone any clue what it could be?

    /update:

    Does it maybe have something to do with my scanner?

    [CODE] scanner = new Scanner(System.in, "ISO-8859-1");
    scanner.useDelimiter("\n|\r\n|\r");
    Last edited by jacsoft; Oct 5th, 2009 at 04:43 PM.
    Don't Hate Me Cause You Ain't Me

Posting Permissions

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



Click Here to Expand Forum to Full Width