Eclipse open console apps in separate window

前端 未结 3 1321
遇见更好的自我
遇见更好的自我 2020-12-03 10:32

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 applic

相关标签:
3条回答
  • 2020-12-03 11:13

    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)

    0 讨论(0)
  • 2020-12-03 11:23

    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.

    0 讨论(0)
  • 2020-12-03 11:28

    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.

    0 讨论(0)
提交回复
热议问题