从 Eclipse 启动应用程序时如何启动 java 控制台?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1729310/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:08:46  来源:igfitidea点击:

How to start the java console when launching an application from Eclipse?

javaeclipseconsole

提问by Jenny Smith

When I start a java application, the Java Console is started. But when I start a java application from Eclipse, the Java Console does not start on its own. How can I make it start also when I run an application from Eclipse?

当我启动 Java 应用程序时,会启动 Java 控制台。但是当我从 Eclipse 启动 Java 应用程序时,Java 控制台不会自行启动。当我从 Eclipse 运行应用程序时,如何让它也启动?

回答by Diego Dias

Take a look at this topic.. I think it is exactly what you want.

看看这个话题.. 我认为这正是你想要的。

There is an answer of how to be able to use step-through debugging from Eclipse.

有一个关于如何能够从 Eclipse 使用逐步调试的答案。

回答by Eugeniu Torica

What for do you need java console? There is window console in Eclipse IDE where all System.out.println are redirected.

你需要java控制台做什么?Eclipse IDE 中有窗口控制台,所有 System.out.println 都在其中重定向。

回答by Kelly S. French

If you are wanting the program to start in it's own window. Try running it as an external tool. The program would be cmd.exe and the argument would be your java command line, e.g. "java -cp c:\myclasspath myProg" and so forth.

如果您希望程序在它自己的窗口中启动。尝试将其作为外部工具运行。该程序将是 cmd.exe,参数将是您的 java 命令行,例如“java -cp c:\myclasspath myProg”等等。

回答by Kennet

First check that no other console is pinned, icon looks like window with a needle in it. This means that no other console except the one that is pinned will show the output. If everything else fails try to reset the java perspective in Eclipse.

首先检查是否没有固定其他控制台,图标看起来像带有针的窗口。这意味着除了被固定的控制台之外,没有其他控制台会显示输出。如果其他一切都失败了,请尝试在 Eclipse 中重置 Java 透视图。