IntelliJ IDEA overviewIntelliJ IDEA概述
IntelliJ IDEA is an Integrated Development Environment (IDE) for JVM languages designed to maximize developer productivity. IntelliJ IDEA是一个针对JVM语言的集成开发环境(IDE),旨在最大限度地提高开发人员的生产率。It does the routine and repetitive tasks for you by providing clever code completion, static code analysis, and refactorings, and lets you focus on the bright side of software development, making it not only productive but also an enjoyable experience.它通过提供巧妙的代码完成、静态代码分析和重构,为您完成日常和重复的任务,并让您专注于软件开发的光明面,使其不仅高效而且令人愉快。
Multi-platform
IntelliJ IDEA is a cross-platform IDE that provides consistent experience on Windows, macOS, and Linux.IntelliJ IDEA是一个跨平台的IDE,在Windows、macOS和Linux上提供一致的体验。
-
See Install IntelliJ IDEA for OS-specific instructions.有关操作系统特定的说明,请参阅安装IntelliJ IDEA。 -
See IntelliJ IDEA keyboard shortcuts for instructions on how to choose the right keymap for your operating system, and learn the most useful shortcuts.有关如何为您的操作系统选择正确的键盘映射的说明,请参阅IntelliJ IDEA键盘快捷键,并了解最有用的快捷键。
Supported languages支持的语言
Development of modern applications involves using multiple languages, tools, frameworks, and technologies. 现代应用程序的开发涉及使用多种语言、工具、框架和技术。IntelliJ IDEA is designed as an IDE for JVM languages but numerous plugins can extend it to provide a polyglot experience.IntelliJ IDEA是为JVM语言设计的IDE,但许多插件可以扩展它以提供多语言体验。
JVM languages
Use IntelliJ IDEA to develop applications in the following languages that can be compiled into the JVM bytecode, namely:使用IntelliJ IDEA用以下语言开发可编译为JVM字节码的应用程序,即:
Other languages其他语言
Plugins bundled with IntelliJ IDEA and available out of the box add support for some of the most popular languages, namely:与IntelliJ IDEA捆绑的插件和现成的插件增加了对一些最流行语言的支持,即:
-
JavaScript (full WebStorm functionality)
-
TypeScript (full WebStorm functionality)
- Thymeleaf
- JSON
- Markdown
- HTML and XHTML
- XML and XSL
- XPath and XSLT
- Velocity and FreeMarker
-
Stylesheets (CSS, Less, Sass)
- Dart
- Erlang
You can browse the JetBrains Marketplace to find an official plugin that adds support for almost any language, framework or technology used today, or for third-party plugins. 您可以通过浏览JetBrains Marketplace来找到官方插件,该市场增加了对目前使用的几乎任何语言、框架或技术的支持,或者对第三方插件的支持。See Manage plugins for details on how to manage plugins in IntelliJ IDEA.有关如何在IntelliJ IDEA中管理插件的详细信息,请参阅管理插件。
Do I need a language plugin for IntelliJ IDEA or a separate IDE?我需要IntelliJ IDEA的语言插件还是单独的IDE?
IntelliJ IDEA Ultimate is a superset of most IntelliJ platform-based IDEs. IntelliJ IDEA Ultimate是大多数基于IntelliJ平台的IDE的超集。If the bundled language plugins are enabled, it includes support for all technologies that are available within our more specific IDEs, such as PyCharm, WebStorm, PHPStorm, and so on.如果绑定的语言插件被启用,它将支持我们更具体的IDE中可用的所有技术,如PyCharm、WebStorm、PHPStorm等等。
So, for example, if your application's codebase is mainly in Java, but it also uses Python scripts, we recommend using IntelliJ IDEA in combination with the bundled Python plugin. 因此,例如,如果应用程序的代码库主要是Java,但它也使用Python脚本,那么我们建议将IntelliJ IDEA与捆绑的Python插件结合使用。If your codebase is mainly in Python, PyCharm is the right IDE for you.如果您的代码库主要是Python,那么PyCharm就是适合您的IDE。
IntelliJ IDEA editionsIntelliJ IDEA版本
IntelliJ IDEA comes in three editions:IntelliJ IDEA有三个版本:
-
IntelliJ IDEA Ultimate: the commercial edition for JVM, web, and enterprise development.IntelliJ IDEA Ultimate:用于JVM、web和企业开发的商业版。It includes all the features of the Community edition, plus adds support for languages that other IntelliJ platform-based IDEs focus on, as well as support for a variety of server-side and front-end frameworks, application servers, integration with database and profiling tools, and more.它包括社区版的所有功能,还添加了对其他基于IntelliJ平台的IDE关注的语言的支持,以及对各种服务器端和前端框架、应用程序服务器、与数据库和分析工具的集成等的支持。 -
IntelliJ IDEA Community Edition: the free edition based on open-source for JVM and Android development.IntelliJ IDEA社区版:基于开源的JVM和Android开发的免费版。 -
IntelliJ IDEA Edu: the free edition with built-in lessons for learning Java, Kotlin, and Scala, interactive programming tasks and assignments, and special features for teachers to create their own courses and manage the educational process (see IntelliJ IDEA Edu).IntelliJ IDEA教育版:免费版,内置用于学习Java、Kotlin和Scala的课程,交互式编程任务和作业,以及教师创建自己的课程和管理教育过程的特殊功能(请参阅IntelliJ IDEA Edu)。
See the IntelliJ IDEA editions comparison matrix.请参见IntelliJ IDEA版本比较矩阵。
The Early Access program早期访问计划
IntelliJ IDEA Ultimate is available for free within the Early Access Program (EAP). IntelliJ IDEA Ultimate在早期访问计划(EAP)中免费提供。EAP builds are published before the release of a stable product version, and you can download them to try out the new features before they are publicly available in return for your feedback. EAP版本在稳定的产品版本发布之前发布,您可以下载这些版本以试用新功能,然后再将其公开,以获得反馈。EAP builds are configured to collect feature usage statistics, and are a valuable source of information for our developers. EAP构建被配置为收集功能使用统计信息,对于我们的开发人员来说是一个有价值的信息源。You can also report an issue if you encounter any problems.如果遇到任何问题,也可以报告问题。
User Interface用户界面
IntelliJ IDEA provides an editor-centric environment. IntelliJ IDEA提供了一个以编辑器为中心的环境。It follows your context and brings up the necessary tools automatically to help you minimize the risk of interrupting the developer's flow.它遵循您的上下文并自动提供必要的工具,以帮助您将中断开发人员流程的风险降至最低。
Take a guided tour around IntelliJ IDEA user interface.在IntelliJ IDEA用户界面周围进行导游。
Ergonomic design and customizable appearance符合人体工程学的设计和可定制的外观
One of the best things about IntelliJ IDEA is its tunability. You can configure virtually anything: the IDE appearance, the layout of tool windows and toolbars, code highlighting, and more. IntelliJ IDEA最好的地方之一是它的可调性。您几乎可以配置任何东西:IDE外观、工具窗口和工具栏的布局、代码高亮显示等等。There are also numerous ways you can fine-tune the editor and customize its behavior to speed up navigation and get rid of any extras that distract you from code.您还可以通过多种方式微调编辑器并自定义其行为,以加快导航速度,并消除使您从代码中分心的任何额外内容。
-
Configure the colors and fonts for your source code, console output, debugger information, search results, and more.为源代码、控制台输出、调试器信息、搜索结果等配置颜色和字体。You can choose from a number of predefined color schemes or customize a scheme to create a unique working environment.您可以从许多预定义的颜色方案中进行选择,也可以自定义方案以创建独特的工作环境。 -
Learn how to configure the editor settings, including appearance, font, code formatting, and more.学习如何配置编辑器设置,包括外观、字体、代码格式等。 -
Customize menus and toolbars to spare the annoyance of looking for an action among a dozen buttons you never use.自定义菜单和工具栏,省去在十几个你从未使用过的按钮中寻找动作的麻烦。
Shortcuts for everything各种快捷键
In IntelliJ IDEA, you have shortcuts for nearly every action, including selection and switching between the editor and various tool windows.在IntelliJ IDEA中,几乎每个操作都有快捷方式,包括在编辑器和各种工具窗口之间进行选择和切换。
Use the most useful shortcuts to invoke frequent actions without switching your focus from the editor and tune your keymap to assign custom shortcuts for your favorite commands.使用最有用的快捷方式来调用频繁的操作,而无需从编辑器切换焦点,并调整键映射以为您喜爱的命令指定自定义快捷方式。
Watch this video to learn about some of the most useful shortcuts:观看此视频了解一些最有用的快捷方式:
Navigation and search导航和搜索
IntelliJ IDEA provides quick navigation not only inside source code files but also throughout the entire project.IntelliJ IDEA不仅提供源代码文件内部的快速导航,还提供整个项目的快速导航。
One of the most useful shortcuts that is worth remembering is double Shift that brings up the Search Everywhere dialog: start typing and IntelliJ IDEA will look for your search string among all files, classes, and symbols that belong to your project, and even among the IDE actions.值得记住的最有用的快捷方式之一是double Shift,它会打开“随处搜索”对话框:开始键入,IntelliJ IDEA将在属于项目的所有文件、类和符号中,甚至在IDE操作中查找搜索字符串。

Here are some of the most useful navigation shortcuts:以下是一些最有用的导航快捷方式:
Double Shift | |
Ctrl+Shift+N | |
Ctrl+N | |
Ctrl+Alt+Shift+N | |
Ctrl+B |
See Source code navigation for more hints on how to navigate through the source code, and learn the most useful shortcuts that help you quickly switch between the editor and various tool windows, switch focus, jump to the Navigation bar, and so on.有关如何在源代码中导航的更多提示,请参阅源代码导航,并学习帮助您在编辑器和各种工具窗口之间快速切换、切换焦点、跳转到导航栏等最有用的快捷方式。
Recent files and locations最近的文件和位置
Normally, you work with a small subset of files at a time and need to switch between them quickly. 通常,您一次只处理一小部分文件,需要在它们之间快速切换。The Recent Files action is a real time-saver here. 最近的文件操作在这里是一个实时的节省程序。Press Ctrl+E to see a list of last accessed files. Note that you can also use this action to open any tool window:按Ctrl+E以查看上次访问的文件列表。请注意,您也可以使用此操作打开任何工具窗口:

Apart from jumping to a recent file, you can also get quick access to Recent Locations- that is code snippets you last viewed or edited. 除了跳转到最近的文件外,您还可以快速访问最近的位置,即您上次查看或编辑的代码段。Press Ctrl+Shift+E and you'll be able to jump to a particular line you modified lately:按Ctrl+Shift+E,您将能够跳转到最近修改的特定行:

File structure文件结构
Press Ctrl+F12 to open the file structure popup that gives you an overview of all elements used in the current file and lets you jump to any of them:按Ctrl+F12打开“文件结构”弹出窗口,该弹出窗口提供当前文件中使用的所有元素的概览,并允许您跳转到任意元素:

Alternatively, use the Structure tool window Alt+7或者,使用“结构”工具窗口Alt+7
Find action查找操作
If you don't remember the shortcut or the menu path for an action you want to use, press Ctrl+Shift+A and start typing the action name:如果不记得要使用的操作的快捷方式或菜单路径,请按Ctrl+Shift+A并开始键入操作名称:

Coding assistance编码辅助
Code completion代码补全
IntelliJ IDEA helps you speed up the coding process by providing context-aware code completion.IntelliJ IDEA通过提供上下文感知的代码补全,帮助您加快编码过程。
-
Basic completion helps you complete the names of classes, methods, fields, and keywords within the visibility scope:基本补全帮助您完成可见性范围内的类、方法、字段和关键字的名称: -
Smart completion suggests the most relevant symbols applicable in the current context when IntelliJ IDEA can determine the appropriate type:当IntelliJ IDEA可以确定合适的类型时,智能补全建议在当前上下文中适用的最相关符号:
For more information on the different types of code completion available in IntelliJ IDEA with examples and productivity tips, see Code completion.有关IntelliJ IDEA中提供的不同类型的代码完成以及示例和生产技巧的更多信息,请参阅代码补全。
Refactorings重构
IntelliJ IDEA offers a comprehensive set of automated code refactorings that lead to significant productivity gains. IntelliJ IDEA提供了一套全面的自动化代码重构,可显著提高生产率。For example, when you rename a class, the IDE will update all references to this class throughout your project.例如,当您重命名一个类时,IDE将在整个项目中更新对该类的所有引用。
You don't even need to bother to select anything before you apply a refactoring. 在应用重构之前,您甚至不需要费心去选择任何东西。IntelliJ IDEA is smart enough to figure out which statement you're going to refactor, and only asks for confirmation if several choices are possible. IntelliJ IDEA非常聪明,能够确定要重构的语句,并且只要求确认是否有几种选择。Just press Ctrl+Alt+Shift+T to open a list of refactorings available in the current context: 只需按Ctrl+Alt+Shift+T打开当前上下文中可用的重构列表:
See section Refactoring code for a full list of available refactorings with usages scenarios and the before and after examples.有关可用重构的完整列表,请参阅重构代码一节,其中包括使用场景和前后示例。
Learn some of the most useful refactoring shortcuts:了解一些最有用的重构快捷键:
Ctrl+Alt+Shift+T | |
Shift+F6 | |
Ctrl+Alt+V | |
Ctrl+Alt+F | |
Ctrl+Alt+C | |
Ctrl+Alt+M | |
Ctrl+Alt+P | |
Ctrl+Alt+N | |
F5 | |
F6 |
Static code analysis静态代码分析
IntelliJ IDEA provides a set of inspections that are built-in static code analysis tools. IntelliJ IDEA提供了一组检查,这些检查是内置的静态代码分析工具。They help you find potential bugs, locate dead code, detect performance issues, and improve the overall code structure.它们可以帮助您发现潜在的bug、定位死代码、检测性能问题并改进总体代码结构。
Inspections not only tell you where a problem is but also provide quick fixes that help you deal with it right away. 检查不仅可以告诉您问题所在,还可以提供快速修复,帮助您立即解决问题。Click the red bulb next to the highlighted code, or press Alt+Enter to choose a fix:单击高亮显示的代码旁边的红色灯泡,或按Alt+Enter选择修复:

Apart from quick-fixes, IntelliJ IDEA also provides intention actions that help you apply automatic changes to code that is correct. 除了快速修复外,IntelliJ IDEA还提供意图操作,帮助您对正确的代码应用自动更改。For example, you can inject a language, add Java annotations, add JavaDoc, convert HTML or XML tags, and much more. 例如,您可以插入语言、添加Java注释、添加JavaDoc、转换HTML或XML标记,等等。To view a full list of intention actions, in the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | Intentions.要查看意图操作的完整列表,请在“设置/首选项”对话框Ctrl+Alt+S中,转到“编辑器”|“意图”。
Code generation代码生成
IntelliJ IDEA provides multiple ways to generate common code constructs and recurring elements, which helps you increase productivity by delegating routine tasks to the IDE. IntelliJ IDEA提供了多种方法来生成通用代码构造和循环元素,通过将日常任务委托给IDE,可以帮助您提高生产率。This includes generating code from predefined or custom code templates, generating wrappers, getters and setters, automatic pairing of characters, and more. 这包括从预定义或自定义代码模板生成代码、生成包装器、getter和setter、自动字符配对等。Press Alt+Insert to open a popup with the available constructs you can generate from your caret position. 按Alt+Insert打开一个弹出窗口,其中包含可以从插入符号位置生成的可用结构。See Generate code for more detail.有关更多详细信息,请参阅生成代码。
Integration with developer tools与开发人员工具的集成
Apart from providing smart navigation and coding assistance, IntelliJ IDEA integrates the essential developer tools and lets you debug, analyze, and version the code base of your applications from within the IDE.除了提供智能导航和编码帮助外,IntelliJ IDEA还集成了基本的开发工具,允许您在IDE中调试、分析和版本化应用程序的代码库。
Debugger调试器
IntelliJ IDEA provides a built-in JVM debugger. IntelliJ IDEA提供了一个内置的JVM调试器。It lets you get and analyze runtime information, which is useful for diagnosing issues and getting a deeper understanding of how a program operates. 它允许您获取和分析运行时信息,这对于诊断问题和深入了解程序的运行方式非常有用。It enables you to:它使您能够:
-
Suspend the program execution to examine its behavior using breakpoints.暂停程序执行以使用断点检查其行为。Multiple types of breakpoints, together with conditions and filters, allow you to specify the exact moment when an application needs to be paused.多种类型的断点以及条件和筛选器允许您指定应用程序需要暂停的确切时间。 -
Play with the program state by modifying variable values, evaluate expressions, and so on.通过修改变量值、计算表达式等来处理程序状态。 -
Examine variable values, call stacks, thread states, and so on.检查变量值、调用堆栈、线程状态等。 -
Control the step-by-step execution of the program.控制程序的逐步执行。
See Tutorial: Debug your first Java application to learn the basics of debugging and play with the debugger features in the IDE.请参阅教程:调试您的第一个Java应用程序,以了解调试的基础知识,并使用IDE中的调试器功能。
Profiler剖析器
IntelliJ IDEA provides the following built-in profiler tools that let you explore which methods consume most CPU time, thus helping you detect the most expensive methods and understand exactly how they behave:IntelliJ IDEA提供以下内置探查器工具,让您探索哪些方法占用最多的CPU时间,从而帮助您检测最昂贵的方法并准确了解它们的行为:
-
The Async Profiler: a tool for Linux and macOS that lets you see how exactly memory and CPU resources are allocated in your application.异步剖析器:一个用于Linux和macOS的工具,可以让您查看应用程序中内存和CPU资源的分配情况。 -
The Java Flight Recorder: a multi-platform tool that collects the information on events at a particular moment in time in a Java Virtual Machine when executing an application.Java飞行记录器:一种多平台工具,用于在Java虚拟机中执行应用程序时收集特定时刻事件的信息。
Terminal终端
IntelliJ IDEA includes a built-in terminal for working with a command-line shell from inside the IDE. IntelliJ IDEA包括一个内置终端,用于从IDE内部使用命令行shell。For example, if you're used to executing Git commands from the command line, you can run them from the Terminal instead of invoking these actions from the menu.例如,如果您习惯于从命令行执行Git命令,那么可以从终端运行它们,而不是从菜单调用这些操作。
The Terminal runs with your default system shell, but it also supports a number of other shells, such as 终端使用默认的系统shell运行,但它也支持许多其他shell,如cmd.exe
, bash
, sh
, and so on.cmd.exe
、bash
、sh
等。
Build tools构建工具
IntelliJ IDEA comes with a fully-functional Gradle and Maven integration that allows you to automate your building process, packaging, running tests, deployment, and other activities.IntelliJ IDEA提供了功能齐全的Gradle和Maven集成,允许您自动化构建过程、打包、运行测试、部署和其他活动。
When you open an existing Gradle or Maven project or create a new one, IntelliJ IDEA detects and automatically downloads all the required repositories and plugins, so you virtually don't need to configure anything and can focus solely on the development process. 当您打开一个现有的Gradle或Maven项目或创建一个新项目时,IntelliJ IDEA会检测并自动下载所有必需的存储库和插件,因此您实际上不需要配置任何东西,只需关注开发过程。You can edit 您可以直接从编辑器编辑build.gradle
and pom.xml
files directly from the editor and configure the IDE to automatically sync all changes to the build configurations.build.gradle
和pom.xml
文件,并将IDE配置为自动同步对生成配置的所有更改。
For instructions on how to work with Gradle and Maven projects in IntelliJ IDEA, see Gradle and Maven.有关如何在IntelliJ IDEA中使用Gradle和Maven项目的说明,请参阅Gradle和Maven。
Version Control版本控制
IntelliJ IDEA provides integration with the most popular version control tools: Git, Mercurial, Perforce, and Subversion.IntelliJ IDEA提供了与最流行的版本控制工具的集成:Git、Mercurial、Perforce和Subversion。
You can review the history of your entire project or separate files, compare file versions, manage branches, and even process GitHub pull requests without leaving the IDE.您可以查看整个项目或单独文件的历史记录,比较文件版本,管理分支,甚至在不离开IDE的情况下处理GitHub 拉取请求。
You can quickly access all VCS actions from the VCS operations popup Alt+`:您可以从VCS操作弹出窗口Alt+`快速访问所有VCS操作:

See Version control for instructions on how to configure integration with your VCS and perform the VCS-related operations.有关如何配置与VCS集成并执行VCS相关操作的说明,请参阅版本控制。
Local History局部历史
Even if no version control is enabled for your project yet, you can still keep track of modifications to your project, and restore deleted files or separate changes with Local History. 即使尚未为项目启用版本控制,您仍然可以跟踪对项目的修改,并使用本地历史恢复删除的文件或单独的更改。It acts as your personal version control system that automatically records your project's revisions triggered by various events as you edit code, run tests, deploy applications, and so on.它充当您的个人版本控制系统,在您编辑代码、运行测试、部署应用程序等时自动记录由各种事件触发的项目修订。

What's next下一步是什么
-
Watch this video tutorial to get started with IntelliJ IDEA观看本视频教程,开始使用IntelliJ IDEA -
Create your first Java application in IntelliJ IDEA在IntelliJ IDEA中创建您的第一个Java应用程序 -
Learn the most useful tips for writing code in IntelliJ IDEA:了解在IntelliJ IDEA中编写代码的最有用提示: -
Get Started with Android development in IntelliJ IDEA.在IntelliJ IDEA中开始Android开发。 -
Happy developing!祝工作愉快!