PRB: ERROR: java.lang.ArrayIndexOutOfBoundsExceptionLast reviewed: January 29, 1998Article ID: Q173788 |
The information in this article applies to:
SYMPTOMSAttempting to execute a Java Application without passing Command-Line or Program Arguments, as your Java application expects, results in the following error:
ERROR: java.lang.ArrayIndexOutOfBoundsException CAUSEThis is because when the Java program accesses the "args" array for the Command-Line or Program arguments, it tries to get items from the array that are out of the arrays bounds (the index used is higher than the number of array items - 1).
RESOLUTIONTo fix this problem, you need to pass in Program Arguments or Command-Line arguments when executing your Java program that expects them. The More Information section below shows how to specify Program Arguments under the IDE. You can also put a try-catch block around the code that accesses the program arguments. This code should catch an ArrayIndexOutOfBoundsException.
STATUSThis behavior is by design.
MORE INFORMATIONWhen executing your Java program under the IDE that expects Command-Line or Program arguments, you can select Settings from the Project menu, click the Debug tab, and select Category:Program arguments to set the program arguments. If you are using Visual J++ 1.0, then you can select Settings from the Build menu, click the Debug tab, and select Category:Program Arguments to set the program arguments.
Steps to Reproduce Behavior
REFERENCESFor the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/ http://support.microsoft.com/support/java/ Keywords : kberrmsg VJGenIss Technology : kbInetDev Version : WINDOWS:1.0,1.1 Platform : WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |