How to pass arguments in the Eclipse Ide console?

Asked

Viewed 1,895 times

1

How to pass arguments in the Eclipse console? For example this program:

public class Eco { 
    public static void main(String[] args) {
        for(int i=0; i<args.length; i++) 
            System.out.println(args[i] + " ");
        System.out.println();
    }

}

I managed to run normally on cmd passing an argument and it displays, and on Eclipse?

1 answer

2


  1. Right click on the project.
  2. Go to Debug As > Debug Configurations or Run As > Run Configurations.
  3. Click on the tab Arguments.
  4. Join your program Program Arguments
  5. Clicking Apply or Debug

enter image description here

Original response: Soen

Browser other questions tagged

You are not signed in. Login or sign up in order to post.