PRB: ERROR: java.lang.ArrayIndexOutOfBoundsException (173788)
The information in this article applies to:
- Microsoft Visual J++ 1.0
- Microsoft Visual J++ 1.1
This article was previously published under Q173788 SYMPTOMS
Attempting 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
CAUSE
This 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).
RESOLUTION
To 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.
STATUS
This behavior is by design.
REFERENCES
For 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:
Modification Type: | Minor | Last Reviewed: | 8/25/2005 |
---|
Keywords: | kbArtTypeINF kberrmsg kbprb KB173788 |
---|
|