user21968
user21968

Reputation: 1165

Open command prompt using Eclipse

I am new to Java and am trying to run a program using Eclipse. But I have no idea how to get the command prompt running in with Eclipse...

I did some online research and couldn't get anything consolidated!

Update:

I'm not using an applet. It's a normal Java program trying to read a line from command prompt. I'm trying to do system programming.

Upvotes: 5

Views: 17140

Answers (4)

KC Baltz
KC Baltz

Reputation: 1508

Check out this lesson plan on how to get started with Eclipse programs:

Lesson

Specifically, see this image:

Picture of Eclipse Console with Standard Input

If the Console tab is not visible in your Eclipse, go to Window -> Show View -> Console in the menu bar.

Upvotes: 7

Karthik Reddy
Karthik Reddy

Reputation: 3052

Right Click on your project--->Run As--->Run Configurations...--->Select Arguments-->Enter the values---->Run

Upvotes: 0

Rayne
Rayne

Reputation: 32675

If you downloaded the Eclipse/Java package, and you wrote a Java program in Eclipse in a project, just click compile and run, it will run in the output window in Eclipse.

Upvotes: 0

Pablo Fernandez
Pablo Fernandez

Reputation: 105258

Try this:


import java.util.Scanner;

    public class ReadFromPrompt{

       public static void main(String[] args) {

           Scanner in = new Scanner(System.in);

           String line = in.nextLine();     

        }
    }

Upvotes: 0

Related Questions