Reputation: 55780
Is there a way to configure eclipse to open console apps in a new window rather than it's own console when you run/debug them?
I'm debugging a client/server application and I'd like to see the output of both apps at once and not have to switch between the tabs...
Upvotes: 21
Views: 39163
Reputation: 975
This is an old question, but I ran across this - and in my case, I have a Python program that I want to run in a separate DOS window.
My solution was to create a run configuration for CMD.exe under "External Tools".
Run > External Tools > External Tools Configurations...
Program
(on the left) and picked New Configuration
and named it "RunFooUnderCMD" (Foo being my project)C:\Windows\System32\cmd.exe
${workspace_loc:Foo/}
/c start cmd /c python -u ${workspace_loc:Foo/path/to/startup.py}
(note that I used forward-slashes even though it is Windows)
and clicked "Apply" and "Close".
Voila! I can navigate to "Run > External Tools > 1 RunFooUnderCMD" and run my program.
Eclipse also automagically provides further menu shortcuts; exploring those are left as an exercise to the reader. :-)
Upvotes: 0
Reputation: 349
When you create the second console, click on "Pin Console" and this will keep the console attached to the last application it was used for.
Upvotes: 2
Reputation: 19702
In eclipse, you can have two console views... On the console view, you have a button called 'open console' (the most right button in the console view). If you click this and select option 3 (new console view), you will see two consoles.
If you right click on the console tab and click on 'detached' the console will be detached from the eclipse frame. (for Eclipse Juno, see the HRJ's comment below)
You can select which output you want to see on each console by clicking the 'display selected console' button (second button from the right on the console view)
Upvotes: 40
Reputation: 1142
I have a different solution to this that works for my situation, and can probably be adapted by others.
I actually want a real second console window -- gnome-terminal in my case. I want this because I want ANSI color support and I want JLine to operate correctly. I can separately start my program and connect remotely for debugging, but that's annoying.
Locate where Java runs from, for the JRE eclipse will run as part of your debug config. Create a script there named gjava, give it the following content, and set it executable:
#!/bin/sh
gnome-terminal -x java $*
Then, in your launch configuration, on the common page, uncheck "Allocate console". On the JRE page, under Java executable, choose "Alternate" and enter gjava.
When Eclipse launches in debug mode, it will launch a gnome terminal and pass the remaining args to the Java processor, which will be running inside its window.
At that point you have a real console that supports JLine, ANSI colors, and full debug support.
Upvotes: 5