Image may be NSFW.
Clik here to view. As a part of our Quick Tips series we will show in this article how to use command prompt from inside Eclipse tool.There are times when we need to use the Windows command prompt for executing standalone Java programs. On the other hand you need to also use the eclipse for doing the development. So frustrating to switch isn’t it. Well, Eclipse tool actually gives us that option to use the windows command prompt inside Eclipse.
Step 1: Setup a new External Configuration Tool
In the Eclipse tool go to Run -> External Tools -> External Tools Configurations option.
Clik here to view.

Step1 External Tool Option in Eclipse
Step 2: Click New Launch Configuration option in Create, manage and run configuration screen
Clik here to view.

Step2 New Configuration Option
Step 3: New Configuration screen for configuring the command prompt
Clik here to view.

Step3 New Configuration Launched
Step 4: Provide configuration details of the Command Prompt in the Main tab
- Name: <<Give any name to your configuration (Here it is Command_Prompt)
- Location: <<Location of the CMD.exe in your Windows>>
- Working Directory: <<Any directory where you want to point the Command prompt>>
Clik here to view.

Step4 Configure CMD Location
Step 5: Tick the check box Allocate console
This will ensure the eclipse console is being used as the command prompt for any input or output.
Clik here to view.

Step5 Allocate Console
Step 6: Click Run and you are there!! You will land up in the C: directory as a working directory
Clik here to view.

Step6 Command Prompt with default working directory
Step 7: Sample commands in the Eclipse console.
Clik here to view.

Step7 Run CMD Commands
That’s it. Please provide your feedback and comment if this tip is useful for you.