IDEA External Tool (Javap -c, SSH, etc.), IDEA external tools

External Tools

You can use an independent third party application is defined as an external tool, and then run them from IntelliJ IDEA.

You can use contextual information in the project as command line arguments (for example, the currently selected file or open the project source path, etc.) is passed to the external tool, view the output generated by the tool is configured to start before the run / debug configuration tool Wait.

IntelliJ IDEA can use different types of external tools:

  • Local external tools are applications that run locally on the computer.

  • Remote SSH external tool is executed via SSH on a remote server.

Add a local external tools

This example demonstrates how to javap add an external tool and use it to compile any class files in the project from IntelliJ IDEA quickly reversed.

  1. in In the Settings / Preferences ⌘ dialog box ,, select Tools | External Tools .

  2. Click Add buttonand specify the following settings:

    Create a tool box

    • Name : will IntelliJ IDEA interface ( "  Tools" name of the tool to display the menu and context menu).

    • Group : Tool name belongs to the group. You can select the name of an existing group or type a new group.

    • Description : meaningful description of the tool.

    • Program : The name of the executable file. If you include a directory is not in your PATHenvironment variables, use the absolute path to specify it.

    • Parameters : parameters passed to the executable file, just as you specified on the command line.

    • Working Directory : the implementation of the current working directory of the tool.

    Use spaces to separate each parameter. Double quotes containing spaces and path parameters. Using as parameters a backslash escape path or a part of double quotes. E.g:-Dmy.prop=\"quoted_value\" "second arg" third" "arg

  3. Click "  OK" to add the tool, and then apply the changes.

To javap tool on the selected class files run the Add, do one of the following:

  • In the main menu, select "  Tools" | "tool." The JDK | javap .

  • In the "  Project" tool window, right-click a file and choose "  the JDK" | "the JDK."  Context menu javap .

  • in In the "Settings / Preferences" ⌘ dialog ,, select the "  keyboard map" , javap in the "  external tools" to find the next node operation, and then assign a shortcut. Run the tool using the shortcut.

When the tool runs, the output is displayed in the "  Run tool" window:

Run external tools

Add Remote SSH external tools

Remote SSH external tool configuration and local external tool is similar, but also defines a remote server on which to perform remote SSH in and requires credentials to connect to it via SSH.

This example demonstrates how to add datethe current date and time as a remote SSH external tools to perform on a remote server, and returns thereon.

  1. in In the Settings / Preferences ⌘ dialog box ,, select Tools | Remote SSH external tools .

  2. Click Add buttonand specify the following settings:

    Create a tool box

    该对话框提供的设置与添加本地外部工具时的设置相同 ,但也建议选择远程服务器。这可能是你的配置的一个 部署服务器 或 流浪框。默认情况下,每次在部署服务器上运行该工具时,IntelliJ IDEA都会询问您主机,端口和相关的SSH凭据。

  3. 单击“ 确定”添加该工具,然后应用更改。

date在远程服务器上运行添加的工具,请执行以下一项操作:

  • 在主菜单中,选择“ 工具” |“工具”。远程工具| 日期和时间

  • 在 “设置/首选项”对话框中⌘,,选择“ 键盘映射”,找到Date and time操作,然后为其分配快捷方式。使用快捷方式运行该工具。

指定主机,端口和凭据后,IntelliJ IDEA将通过SSH连接到服务器并运行date命令,将输出返回到IntelliJ IDEA中的“运行工具”窗口。

网页浏览器

您可以使用Web浏览器打开项目中的任何文件,但通常用于预览HTML文件的输出或运行和调试Web应用程序。

在网络浏览器中打开文件

要打开旨在由Web浏览器呈现的文件(HTML,XML,JSP等),请执行以下任一操作:

  • 按⌥F2。

  • 右键单击文件,然后选择在浏览器中打开

  • 在主菜单中,选择查看| 在浏览器中打开

  • 使用编辑器窗口右上方的浏览器弹出窗口。单击浏览器按钮打开Web服务器文件URL,或⇧+Click打开本地文件URL。

     

“ 在浏览器中打开”操作不适用于其他文件类型。但是,您仍然可以使用Find Action 执行它⇧⌘A。

默认情况下,IntelliJ IDEA支持某些最受欢迎的浏览器,这些浏览器会自动配置(如果可用):

  • chrome浏览器 Chrome icon

  • 火狐浏览器 Firefox browser icon

  • 苹果浏览器 Safari browser icon

  • Opera浏览器 Opera browser icon

  • IE浏览器 

查看和配置浏览器列表

  • 在 设置/首选项对话框中⌘,,选择工具| Web浏览器

Preferences in the "Web Browser" page

如果使用标准过程安装了浏览器,则“ 路径”字段中的别名应指向正确的位置。如果没有,请指定相应可执行文件的路径。

列表中浏览器的顺序与它们在弹出菜单,上下文菜单和“ 查看”菜单中的顺序相对应。如果禁用浏览器,它将不会出现在弹出菜单,上下文菜单和“ 查看”菜单中。

添加自定义浏览器

  1. 在 设置/首选项对话框中⌘,,选择工具| Web浏览器

  2. 单击Add button 并指定浏览器名称,系列和可执行文件或macOS应用程序的位置。

选择默认浏览器

打开在浏览器中的项目视图菜单并在文件中列出了所有可用的浏览器和默认的浏览器,它也被用来渲染外部资源的上下文菜单。

  1. 在 设置/首选项对话框中⌘,,选择工具| Web浏览器

  2. 从“ 默认浏览器”列表中,选择以下选项之一:

    • System Default : use the default browser of the operating system.

    • First list : Use the first browser list.

    • Custom path : the browser is not in the list. Specify the location of the executable file.

Use custom configuration files and settings

You can configure a custom profile for Firefox and Chrome browser series.

  1. in In the Settings / Preferences ⌘ dialog box ,, select Tools | Web browser .

  2. Select the browser in the list, and then click OK Edit button.

    • For Firefox, please specify profiles.ini path to the file, then choose to use the configuration file. For more information, please see the Firefox browser profile .

    • For the browser, select Use custom user data directory  and specify the location of the user data directory .

      You can also specify IntelliJ IDEA run Chrome when you want to use from other command-line options. For more information, please chrome://flagsopen the Chrome address bar.

 
Published 900 original articles · won praise 387 · Views 2.79 million +

Guess you like

Origin blog.csdn.net/kingmax54212008/article/details/104096597