Eclipse在单独的窗口中打开控制台应用

[英]Eclipse open console apps in separate window


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?

有没有办法在新窗口中配置eclipse打开控制台应用程序而不是在运行/调试它们时自己的控制台?

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

我正在调试客户端/服务器应用程序,我希望一次看到两个应用程序的输出,而不必在选项卡之间切换...

3 个解决方案

#1


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.

在eclipse中,您可以拥有两个控制台视图...在控制台视图中,您有一个名为“打开控制台”的按钮(控制台视图中最右侧的按钮)。如果单击此选项并选择选项3(新控制台视图),您将看到两个控制台。

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)

如果右键单击控制台选项卡并单击“已分离”,控制台将与eclipse框架分离。 (对于Eclipse Juno,请参阅下面的HRJ评论)

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)

您可以通过单击“显示所选控制台”按钮(控制台视图右侧的第二个按钮)选择要在每个控制台上查看的输出

#2


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.

我实际上想要一个真正的第二个控制台窗口 - 在我的情况下是gnome-terminal。我想要这个,因为我想要ANSI颜色支持,我希望JLine正常运行。我可以单独启动我的程序并远程连接进行调试,但这很烦人。

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:

找到运行Java的位置,因为JRE eclipse将作为调试配置的一部分运行。创建一个名为gjava的脚本,为其提供以下内容,并将其设置为可执行文件:

#!/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.

然后,在启动配置中,在公共页面上,取消选中“Allocate console”。在JRE页面的Java executable下,选择“Alternate”并输入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.

当Eclipse以调试模式启动时,它将启动一个gnome终端并将剩余的args传递给Java处理器,该处理器将在其窗口内运行。

At that point you have a real console that supports JLine, ANSI colors, and full debug support.

那时你有一个真正的控制台,支持JLine,ANSI颜色和完整的调试支持。

#3


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.

创建第二个控制台时,单击“Pin控制台”,这将使控制台连接到它用于的最后一个应用程序。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2009/05/20/31b48acccbf97329d96109f63748a79.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号