我可以看到 IntelliJ 用于构建 Java 项目的确切命令吗?

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

Can I see the exact commands IntelliJ uses to build a java project?

javaintellij-idea

提问by Blankman

Can I see the exact commands IntelliJ uses to build a java project?

我可以看到 IntelliJ 用于构建 Java 项目的确切命令吗?

回答by CrazyCoder

IDEA is not running java binary, so there is no way to see the commands. Instead, IDEA uses Java compiler API directly. If you want a raw representation of what is done to build the project, you can use Build | Generate Antbuild. Examine the build file or run it from the command line via Ant to see what happens and what options/commands are invoked.

IDEA 未运行 java 二进制文件,因此无法查看命令。相反,IDEA 直接使用 Java 编译器 API。如果您想要构建项目的原始表示,您可以使用Build | 生成 Ant构建。检查构建文件或通过 Ant 从命令行运行它以查看发生了什么以及调用了哪些选项/命令。

回答by Kr1z

If you run a certain run configuration, check the output console (Ctrl+0) For example, it shows something like:

如果您运行某个运行配置,请检查输出控制台(Ctrl+0),例如,它显示如下内容:

"C:\Program Files\Java\jdk1.5.0_22\bin\java" -Didea.launcher.port=7532 "-Didea.launcher...

Process finished with exit code 0

The first line is the command for building and running the module...

第一行是构建和运行模块的命令...

回答by user674669

Look in ~/Library/Logs/IdeaIC13/build-log. You can turn on ALL debugging in build-log.xml in this directory. When you build inside IDEA, it writes a log to build.log in this directory.

查看 ~/Library/Logs/IdeaIC13/build-log。您可以在此目录中的 build-log.xml 中打开所有调试。当您在 IDEA 内部构建时,它会向此目录中的 build.log 写入日志。

回答by Avi

I don't think you can get the output of a build directly, but you can view and edit the compiler options IntelliJ uses, in the Compiler tab of the Settings dialog.

我认为您不能直接获得构建的输出,但您可以在“设置”对话框的“编译器”选项卡中查看和编辑 IntelliJ 使用的编译器选项。

回答by Peter

CTRL-F9

CTRL-F9

for all key commands you can check ( and print) the keymap, its available in hte help tab.

对于所有键命令,您可以检查(和打印)键映射,它在 hte 帮助选项卡中可用。