1

I have a console project in Eclipse.

I want to configure Eclipse to open a Windows Command Prompt window instead of its own console. The cmd window must run the project and do all input and output instead of the Eclipse console window.

This is very easy in C#.

How do I do this?

1 Answers1

1

If this is a console-based application, then merely opening the executable JAR file should make it run in a Command Prompt. This can be done by typing

java -jar "<drive>:\path\to\JAR.jar"

into a CMD window. The program will now run as if it were in the Eclipse console, except in CMD. Using a batch file, you can alter the CMD with

COLOR 0A

as an example.

If you are looking for more of a user-friendly console-based application, you can get the name of the executable JAR and have it run in a ProcessBuilder inside the source code itself. This allows the JAR to open up itself in a CMD.

If I have not specified correctly, do let me know.