You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/pages/learn/01_tutorial/01_your-first-java-app/03_writing-java-applications-with-eclipse.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ subheader_select: tutorials
9
9
main_css_id: learn
10
10
toc:
11
11
- Introduction and Installation {intro}
12
-
- creating Java projects {creating}
12
+
- Creating Java projects {creating}
13
13
- Content Assist {content_assist}
14
14
- Dealing with compilation errors and warnings {errors}
15
15
- Running a program {run}
@@ -35,10 +35,10 @@ Upon selecting a workspace, it will show a Welcome screen presenting you with mu
35
35
This article will show you how to create Java projects manually so you can close the welcome-screen by clicking on the `Hide` button on the top right of the Welcome tab.
36
36
37
37
<aid="creating"> </a>
38
-
## creating Java projects
38
+
## Creating Java projects
39
39
40
40
After installing Eclipse, you should have an empty workspace. In order to create a new Java project, click on the `File`-toolbar on the top left corner of the Eclipse window and select `New` > `Java Project`.
[](/assets/images/eclipse/file_create_project.png)
42
42
43
43
This will then open up a dialog that allows configuring information about the project. You will need to enter a name next to `Project name:` at the top. For example, you can choose the name `HelloWorld`. In the `Module` section at the bottom, disable the option `Create module-info.java file`. If necessary, it is possible to configure a custom Java installation in the `JRE` box.
@@ -85,27 +85,26 @@ In order to run a Java application, you first need to have a class with a `main`
85
85
[](/assets/images/eclipse/run_as_editor.png)
86
86
[](/assets/images/eclipse/run_as_package_explorer.png)
87
87
88
-
Alternatively, you can run the application using the Run [](/assets/images/eclipse/run_button.png) in the toolbar. [](/assets/images/eclipse/run_buttons_toolbar.png)
88
+
Alternatively, you can run the application using the Run [](/assets/images/eclipse/run_button.png)button in the toolbar. [](/assets/images/eclipse/run_buttons_toolbar.png)
89
89
90
90
When running the program, Eclipse should show the output of the program in the `Console` view.
91
91
[](/assets/images/eclipse/console_output.png)
92
92
93
-
94
93
<aid="debugging"> </a>
95
94
## Debugging in Eclipse
96
95
97
96
When a program doesn't do what you expect it to do, you might want to debug it. The process of debugging is explained in [this article](/learn/debugging). Eclipse provides a lot of functionality making it easy to debug Java applications.
98
97
99
-
In order to debug an application, you need to set a breakpoint. When the execution hits that breakpoint the program will temporarily stop ("suspend") and allow you to inspect its current state and step through the program. To set a breakpoint, you need to double-click on the area to the left of the line you want to stop execution at. After doing that, a blue dot should appear there.
98
+
In order to debug an application, you need to set a breakpoint. When the execution hits that breakpoint, the program will temporarily stop ("suspend"), allow you to inspect its current state and step through the program. To set a breakpoint, you need to double-click on the area to the left of the line you want to stop execution at. After doing that, a blue dot should appear there.
100
99
[](/assets/images/eclipse/breakpoint.png)
101
100
102
-
When running a program normally, the program will ignore all breakpoints. For debugging, you need to run the program in debug mode. This can be done by clicking on the green button with the bug icon next to the run button or using `Debug As` > `Java Application`.
103
-
[](/assets/images/eclipse/debug_button.png)
101
+
When running a program normally, it will ignore all breakpoints. For debugging, you need to run the program in debug mode. This can be done by clicking on the green button with the bug icon[](/assets/images/eclipse/debug_button.png) next to the run button or using `Debug As` > `Java Application`.
102
+
[](/assets/images/eclipse/debug_button_in_toolbar.png)
104
103
105
104
When the execution hits a breakpoint in debug mode, Eclipse will ask you to switch to the Debug perspective. This perspective gives you more information about the program you are currently debugging so you likely want to do this and click on the `Switch` button.
106
105
[](/assets/images/eclipse/debug_perspective_switch.png)
107
106
108
-
Upon opening the debug perspective, you should still see your code in the middle. However, there should be one line with a green background. This indicates the next line the program would execute. On the right side, you should see a `Variables` view containing a list of variables and their current values.
107
+
Upon opening the debug perspective, you should still see your code in the middle. However, there should be one line with a green background next to the breakpoint. This indicates the next line the program would execute. On the right side, you should see a `Variables` view containing a list of variables and their current values.
0 commit comments