eclipse Eclipse中的交互式控制台有什么用(调试视图)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11780633/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the use of Interactive Console in Eclipse (Debug view)
提问by Howard
Some threadsasked how to use the "Interactive Console" in Eclipse since you cannot type anything in this console.
一些线程询问如何在 Eclipse 中使用“交互式控制台”,因为您无法在此控制台中键入任何内容。
Some suggested you can "Display view" to execute code.
有人建议您可以“显示视图”来执行代码。
So what is the purpose of the "Interactive Console" then?
那么“交互式控制台”的目的是什么?
采纳答案by Bharat Sinha
EARLIER ANSWER (accepted but not correct):
早期答案(接受但不正确):
The interactive console allows you to execute some extra code, while debugging, when stopped at via a `breakpoint`.
This is a really beneficial feature when you are debugging and suddenly want to change the value of variable, execute a sysout or some utility function.
FOR Correct Answer look at the answer below by @mmey.
对于正确答案,请查看@mmey 下面的答案。
回答by mmey
Eclipse doesn't have an "Interactive Console" in it's default installation. It just has a "Display" view that you can use to execute Java code in debug mode in the scope of the current breakpoint (to evaluate expressions or to change data)
Eclipse 在其默认安装中没有“交互式控制台”。它只有一个“显示”视图,您可以使用它在当前断点范围内以调试模式执行 Java 代码(评估表达式或更改数据)
If you have an "Interactive Console", it's most likely a view from a plugin. I've read that a Google plugin might provide it. Or maybe a plugin for a scripting language like JRuby or Groovy.
如果您有一个“交互式控制台”,它很可能是来自插件的视图。我读过谷歌插件可能会提供它。或者可能是 JRuby 或 Groovy 等脚本语言的插件。
If you say you have an "Interactive Console" and cannot type into it, then I suspect you're not in the right mode for the view to be active (maybe you're not working with the scripting language that provides the view).
如果你说你有一个“交互式控制台”并且无法输入它,那么我怀疑你没有处于激活视图的正确模式(也许你没有使用提供视图的脚本语言)。
回答by deleted_user
Im sorry but the accepted answer is not correct.
对不起,但接受的答案不正确。
The console in Eclipse is interactive, when a running application reads from the Console Input Stream.
当正在运行的应用程序从控制台输入流中读取时,Eclipse 中的控制台是交互式的。
It is not meant to be a feature of Eclipse to generally aid in debugging, it is meant to allow console based Java applications to read input from the user when debugging (as in I can type into a console prompt).
它并不意味着 Eclipse 的一个特性通常有助于调试,它意味着允许基于控制台的 Java 应用程序在调试时从用户读取输入(就像我可以在控制台提示中输入一样)。