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
    Posts
    6
    Rep Power
    0

    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:
    http://www.mediafire.com/download.php?qei3jmj4h4hdtms
    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(IfStatement.java:9)
    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
    Tim

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

    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 - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    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,

    Jos
    quad64bit likes this.
    cenosillicaphobia: the fear for an empty beer glass

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
  •