Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » java.lang.ArrayIndexOutOfBoundsException: 0(when i run this program eclipse send me this exception)
java.lang.ArrayIndexOutOfBoundsException: 0 [message #643082] Fri, 03 December 2010 20:23 Go to next message
carter  is currently offline carter
Messages: 1
Registered: December 2010
Junior Member
Hi Everybody!!!
i'm new on java
this code got it from the solutions of thinking in java
I'm Trying to run this program and it just send me this Exception, i've tried to change
my workspace to other place, reinstall eclipse and it keeps sending same exception any body have had
same error? Sad
please help



this is the exception eclipse send me when i run this program:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at ShowArgs.main(ShowArgs.java:5)

public class ShowArgs {
public static void main(String[] args) {
System.out.println(args[0]);
System.out.println(args[1]);
System.out.println(args[2]);
}
}


i use:
Eclipse SDK
Version: 3.6.1
Build id: M20100909-0800

hope somebody can help me
thank you verymuch
Re: java.lang.ArrayIndexOutOfBoundsException: 0 [message #643192 is a reply to message #643082] Sun, 05 December 2010 17:40 Go to previous message
Eclipse User
Originally posted by: lhasadad.gmail.google.com

Check the length of the array before trying to reference an element in it. you probably started the program
with no arguments....

On 12/3/2010 8:23 PM, carter wrote:
> Hi Everybody!!!
> i'm new on java
> this code got it from the solutions of thinking in java
> I'm Trying to run this program and it just send me this Exception, i've tried to change my workspace to other place, reinstall eclipse and it keeps sending same exception any body have had
> same error? :( please help
>
>
>
> this is the exception eclipse send me when i run this program:
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
> at ShowArgs.main(ShowArgs.java:5)
>
> public class ShowArgs {
> public static void main(String[] args) {
> System.out.println(args[0]);
> System.out.println(args[1]);
> System.out.println(args[2]);
> }
> }
> i use:
> Eclipse SDK
> Version: 3.6.1
> Build id: M20100909-0800
>
> hope somebody can help me
> thank you verymuch
Previous Topic:A time-out error when attempting to profile large application
Next Topic:problems with GWT RPC
Goto Forum:
  


Current Time: Sat Jul 26 09:15:08 EDT 2014

Powered by FUDForum. Page generated in 0.01584 seconds