Results 1 to 2 of 2
  1. #1
    Amateur1980 is offline Member
    Join Date
    Nov 2007
    Posts
    1
    Rep Power
    0

    Default how to enable jcreator to accept command line arguments?

    Guys,

    This is my first post. So, hello to everyone :)

    Am using Jcreator and i have writtern a simple program to accept two numbers and compare them to see which is bigger.

    Problem am facing is, i am not able to give my inputs to the program when i "Run Project" using Jcreator!! It runs and throws the below error..

    This is to find maximum of two numbers
    Enter the First Number
    Length :0
    java.lang.ArrayIndexOutOfBoundsException: 0
    at maxTwo.main(maxTwo.java:18)
    Exception in thread "main"
    Process completed.

    But i can run the same program via command prompt and get the correct output as below


    D:\Official\Java Apps>java maxTwo 45 43
    This is to find maximum of two numbers
    Enter the First Number
    Length :2
    Enter the Second Number
    First number45is greater than43

    Please suggest.

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    10

    Default

    Hmm, it took lots of time since i use jcreator but all IDEs use similar logic to handle JVM parameters for projects. Find rpoject properties, (I guess it will be open if you right click to the project and select "Properties" or it might be under "Project" menu if any.) So this is a project level parameter to set, if you find where to modify project parameters, you will find a way there to specify program input! Hope this helps.

Similar Threads

  1. Command line argument
    By denisatandi in forum New To Java
    Replies: 8
    Last Post: 10-16-2012, 11:37 PM
  2. Printing command line arguments
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 09:27 AM
  3. Exporting from the command line
    By o1121 in forum Eclipse
    Replies: 1
    Last Post: 08-09-2007, 07:29 PM
  4. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:23 AM
  5. Java Command Line Arguments In Eclipse IDE
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 05-19-2007, 09:45 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
  •