Skip to content

Commit f00951e

Browse files
authored
Update 02_building-with-intellij-idea.md
Correct small typos. (a missing . and empty lines after titles)
1 parent e8efade commit f00951e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/pages/learn/01_tutorial/01_your-first-java-app/02_building-with-intellij-idea.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ author: ["MaritvanDijk"]
3030

3131
<a id="overview">&nbsp;</a>
3232
## Overview
33+
3334
An IDE (Integrated Development Environment) allows you to quickly create applications, by combining a source-code editor with the ability to compile and run your code, as well as integration with build, test and debug tools, version control systems, and so on. Finally, an IDE will let you search and navigate your codebase in ways your file system won’t.
3435

3536
One of the [most widely used integrated development environments (IDEs)](https://www.jetbrains.com/lp/devecosystem-2023/java/#java_ide) for Java is IntelliJ IDEA. Its user-friendly interface, rich feature set, and vast ecosystem make it an ideal environment for beginners to learn and grow as developers. In this tutorial you’ll learn how to use some of its features to simplify your development process and accelerate your learning curve with Java programming.
3637

3738
<a id="install">&nbsp;</a>
3839
## Installing IntelliJ IDEA
40+
3941
To install IntelliJ IDEA, download the version you want to use from the [IntelliJ IDEA website](https://www.jetbrains.com/idea/) and follow the instructions.
4042
Note that IntelliJ IDEA is available in two editions:
4143
- **_IntelliJ IDEA Community Edition_** - free and open-source. It provides all the basic features for Java development.
@@ -51,6 +53,7 @@ To start working with Java, you will need to install a JDK. You can do this your
5153

5254
<a id="new">&nbsp;</a>
5355
## Creating a new project
56+
5457
We can create a new project from the **Welcome** screen, or we can go to **File | New | Project** in the main menu.
5558

5659
[![New Project menu](/assets/images/intellij-idea/new-project-menu.png)](/assets/images/intellij-idea/new-project-menu.png)
@@ -94,6 +97,7 @@ You can add a new Java file using the shortcut **⌘N** (on macOS) or **Alt+Inse
9497

9598
<a id="edit">&nbsp;</a>
9699
## Writing and editing code
100+
97101
The entrypoint to execute your `HelloWorld` Java program is the main method. Add the main method by typing:
98102
```java
99103
public static void main(String[] args) {
@@ -126,6 +130,7 @@ IntelliJ IDEA will manage the formatting of your code as you write it. If needed
126130

127131
<a id="run">&nbsp;</a>
128132
## Running your application
133+
129134
A major benefit of using an IDE is that you can directly run your code without having to first manually compile it on the command line.
130135

131136
You can run the `HelloWorld` application directly from the editor, by clicking the green run button in the gutter near the class declaration, or using the shortcut **⌃⇧R** (on macOS) or **Ctrl+Shift+F10** (on Windows/Linux).
@@ -146,6 +151,7 @@ The popup **Run/Debug Configurations** appears and there you can modify JVM opti
146151

147152
<a id="test">&nbsp;</a>
148153
## Testing
154+
149155
Testing your code helps you to verify that the code does what you expect it to do. You can run your application and test it yourself, or add automated tests that can verify your code for you. Thinking about what to test and how, can help you to break a problem up into smaller pieces. This will help you get a better solution faster!
150156

151157
For example, let's say we have a `Calculator` class containing the following method that calculates the average of a list of values, and we want to make sure the average is calculated correctly:
@@ -210,6 +216,7 @@ In our example, we see that the second tests fails. We expected to get the value
210216

211217
<a id="debug">&nbsp;</a>
212218
## Debugging
219+
213220
We might want to see how our code runs, either to help us understand how it works and/or when we need to fix a bug or failing test, like the one above. We can run our code through the [debugger](https://www.jetbrains.com/help/idea/debugging-code.html) to see the state of our variables at different times, and the call stack - the order in which methods are called when the program executes. To do so, we must first add a [breakpoint](https://www.jetbrains.com/help/idea/using-breakpoints.html) to the code.
214221

215222
To add a breakpoint, click the gutter at the line of code where you want execution to stop. Alternatively, place the caret at the line and press **⌃F8** (on macOS) or **Ctrl+F8** (on Windows/Linux). We can run our test or application using the **Debug** option; either by right-clicking the **Run** button in the gutter and selecting the **Debug** option from the list, or by selecting the **Debug** button at the top right.
@@ -240,7 +247,7 @@ public class Calculator {
240247
```
241248
Now, when we run our tests, we see that they pass.
242249

243-
For more information on debugging, see [Debugging in Java](https://dev.java/learn/debugging/)
250+
For more information on debugging, see [Debugging in Java](https://dev.java/learn/debugging/).
244251

245252
<a id="refactor">&nbsp;</a>
246253
## Refactoring code
@@ -259,12 +266,14 @@ Pull up the refactoring menu to see what is possible, using the shortcut **⌃T*
259266

260267
<a id="document">&nbsp;</a>
261268
## Documenting code
269+
262270
We can add documentation to our code. IntelliJ IDEA provides completion for documentation comments, which is enabled by default. Type `/**` before a declaration and press **Enter**. IntelliJ IDEA auto-completes the documentation comment for you.
263271

264272
IntelliJ IDEA provides a way for you to easily understand and read JavaDoc comments by selecting _Reader Mode_. **Toggle Reader Mode** in the editor using **^⌥Q** (on macOS) or **Ctrl+Alt+Q** (on Windows/Linux). Right-click the icon in the gutter to select **Render All Doc Comments** if you want all comments to show in reader mode.
265273

266274
<a id="navigation">&nbsp;</a>
267275
## Searching and navigating
276+
268277
IntelliJ IDEA also helps us by providing ways to navigate around our codebase, for example by going backwards and forwards between files, finding usages and declarations, finding interfaces and their implementations, viewing recently opened files and location, or even opening a window by name.
269278

270279
One popular way to search is [Search Everywhere](https://www.jetbrains.com/help/idea/searching-everywhere.html) (using **Shift** twice). Search everywhere allows you to search your project files and directories, as well as your project settings and IntelliJ IDEA settings.
@@ -277,6 +286,7 @@ Another popular way to search is [Find in Files](https://www.jetbrains.com/help/
277286

278287
<a id="summary">&nbsp;</a>
279288
## Summary
289+
280290
In this article, we’ve seen how IntelliJ IDEA can help you with code suggestions and completion while writing code, running your application, adding tests and using the debugger to help figure out how code is run, refactoring code, and more.
281291

282292
IntelliJ IDEA continues to improve and evolve, adding new features and offering new integration. You can sharpen your coding skills by taking a look at the [documentation](https://www.jetbrains.com/help/idea/getting-started.html), [blog](https://blog.jetbrains.com/idea/), [YouTube channel](https://www.youtube.com/intellijidea), or [guide](https://www.jetbrains.com/guide/java/).

0 commit comments

Comments
 (0)