Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By JosAH

Thread: Problem with eclipse?

  1. #1
    D-X69's Avatar
    D-X69 is offline Member
    Join Date
    Nov 2011
    Rep Power

    Question Problem with eclipse?

    I'm now switched over to eclipse from VIM. I'm still new to Java. For example this simple program:
    Java Code:
    When I compile/run with VIM. I run with "java IfStatement 1" then it will show whether the results according to the If Statements.

    But when I use eclipse and hit the run button it tend to give me this error:
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
    at IfStatement.main(
    I couldn't seem to input my number. So I'm not sure how to run with eclipse.

    Can you sort this out for me? Thanks

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: Problem with eclipse?

    First of all, you should post your code here in the form of an SSCCE. Some of us (including myself) are behind firewalls that block sites like mediafire.

    Secondly, this has nothing to do with eclipse. That is a runtime error, and you'd get the same thing no matter how you were running it.

    Try compiling and running from the command line to see what I mean.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power

    Default Re: Problem with eclipse?

    Quote Originally Posted by D-X69 View Post
    Can you sort this out for me? Thanks
    Also in Eclipse you have to specify command line arguments (your program expects them). Define a 'Configuration'; i.e. specify that you want to run a Java application (not an Applet), define a name for the Configuration and define the main class to be started. The dialog has a tab where you can define the command line arguments for that main class. Just play a bit with it and you'll figure it out.

    kind regards,

    quad64bit likes this.
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. problem of Eclipse IDE
    By Dhanasekarani in forum Eclipse
    Replies: 1
    Last Post: 04-02-2012, 05:34 PM
  2. eclipse problem
    By sushma.salian in forum Web Frameworks
    Replies: 0
    Last Post: 02-23-2011, 12:45 AM
  3. Problem in eclipse
    By amitabh in forum Eclipse
    Replies: 6
    Last Post: 05-01-2010, 02:01 PM
  4. Problem with Eclipse
    By lobodelbosque in forum New To Java
    Replies: 3
    Last Post: 11-24-2009, 08:49 PM
  5. RAM Problem Eclipse
    By samKnop in forum Eclipse
    Replies: 3
    Last Post: 04-21-2009, 05:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts