没有简单的运行按钮在使用VS Code中的Java时。

huangapple go评论74阅读模式
英文:

No easy run button when using Java in VS Code

问题

我是一名软件开发者,在尝试运行 Java 时遇到了 Visual Studio Code 的问题。在运行其他语言(如 Python)时,右上角有一个绿色三角形按钮,可以方便地运行我的代码;然而,在尝试运行 Java 时,那个按钮不见了,我必须手动从屏幕顶部的“运行”选项卡中选择“Run Code”。是否有办法在使用 Java 时也能得到相同的绿色运行按钮?感谢您的时间。

英文:

I am a software developer and am having a problem with Visual Studio Code while trying to run Java. When running other languages (such as python) there is a green triangular button on the top right that allows an easy way to run my code, however, when I trying running Java there arrow is not there and I have to manually select "Run Code" from the "Run" ribbon at the top of the screen. Is there any way that I could get the same green run button when using Java? Thank you for your time.

答案1

得分: 2

按下Ctrl+F5以无调试方式运行,按F5以带调试器运行。
您可以使用集成终端进行编译和执行,方法是使用javac <filename>.java进行编译,然后使用java <filename>进行执行。

设置您自己的键绑定。

预设快捷键

英文:

Press crtl+F5 to run without debugging and F5 running with debugger.
You can use the integrated terminal for compiling and executing by using the javac &lt;filename&gt;.java for compiling and java &lt;filename&gt; for executing.

Set your own key bindings.

Preset shortcuts

答案2

得分: 2

在扩展市场安装 Java Extension Pack 将解决你的问题,你还可以安装 Code Runner,它还提供了一个用于运行代码的按钮。

英文:

Install Java Extension Pack in extension marketplace will solve your question, also you can install Code Runner which provides button for code running too.
没有简单的运行按钮在使用VS Code中的Java时。

huangapple
  • 本文由 发表于 2020年8月31日 12:03:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/63664648.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定