You're probably failing to quote your input parameters. It looks like you're running:
java -cp . test 1,2,3 4,5,6 7,8,9
Which will set args to
["1,2,3", "4,5,6", "7,8,9"]
But you're running args[0].split(" ");
You can fix this by just setting
String menge1 = args[0];
String menge2 = args[1];
String menge3 = args[2];
Or by running your program as
java -cp . test "1,2,3 4,5,6 7,8,9"