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:

- "javac Main.java"

It gives no error and makes a class.

Now I run the program with:


- "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:

s = subResultaat2.split("°°")[1];

But the same thing does work in NetBeans. Anyone any clue what it could be?

Does it maybe have something to do with my scanner?

[code] scanner = new Scanner(System.in, "ISO-8859-1");