Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse open console apps in separate window

Tags:

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...

like image 912
Omar Kooheji Avatar asked May 20 '09 15:05

Omar Kooheji


People also ask

How do I open multiple consoles in Eclipse?

The best thing you can do is the following. Window > New Window. That will create another eclipse window like you currently have. Run the desired application, switch the console on the new window to display the desired console output with open console button on the console view.

How do I dock the console window in Eclipse?

How to make the console attach to the eclipse main window? You can click Window->Perspective->Reset Perspective to rest it. If you have foud the console is not displayed on the eclipse main window, you can show it. You can click Window->Show View->Console to make the console attach to the main window.


2 Answers

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)

like image 55
Fortega Avatar answered Oct 12 '22 12:10

Fortega


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.

like image 40
Ross Judson Avatar answered Oct 12 '22 12:10

Ross Judson