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: 03_java/01_installation_and_quick_start.md
+13-11
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
-
# Getting Started With Java
1
+
# Installation And Quickstart
2
+
3
+

2
4
3
5
To build things using Java, you need the Java Development Kit (JDK). It is one of the three core technology packages used in Java programming. The other two are the Java Virtual Machine (JVM) and the Java Runtime Environment (JRE).
4
6
@@ -19,7 +21,7 @@ To build things using Java, you need the Java Development Kit (JDK). It is one o
19
21
20
22
I will show you how to install the open-source JDK (OpenJDK) from Amazon called the [Amazon Corretto](https://aws.amazon.com/corretto/?filtered-posts.sort-by=item.additionalFields.createdDate&filtered-posts.sort-order=desc). As of this writing, I will be showing you how to download [Amazon Corretto 17](https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/downloads-list.html).
You can choose to either use the terminal commands to download the JDK or you can click on the highlighted link to download directly from the site. Ensure that you download the file to a location you want, say in the home directory, for example.
25
27
@@ -121,32 +123,32 @@ When working with Java Projects, VS Code does not offer core support the way Int
121
123
122
124
At this point, you should already have the [Extension pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) installed. To create a Java Project, open VS Code.
123
125
124
-

126
+

125
127
126
128
Select on "File Explorer" to access the "Create Java Project" button. Click on it.
Notice that the project comes with a structure already. In the example above, I have already clicked on the `App.java` file. You can do the same. To run it, you can press the "play" button on the top-right, or `f5`. Alternatively, you can right-click on the file to access the command "Run Java". Select it and you will see the text "Hello World" displayed on the terminal.
140
+
Notice that the project comes with a structure already. In the example above, I have already clicked on the `App.java` file. You can do the same. To run it, you can press the **"play"** button on the top-right, or `f5`. Alternatively, you can **right-click on the file to access the command "Run Java"**. Select it and you will see the text "Hello World" displayed on the terminal.
139
141
140
142
## Changing the Default JDK
141
143
142
144
You may notice that when you run the script above, the default JDK 11 is used instead of the newly installed Amazon Corretto 17. Typically, this is an issue to do with the path to the jdk. If we want to use Amazon Corretto 17, then we need to modify our settings to point to this jdk.
143
145
144
146
145
147
- Click on "Java Projects" at the bottom left of the VS Code's sidebar to access `...` more actions option.
-MyVSCode is already configured to use Corretto17, but by default, the version number may be 11.This is different from our installation efforts above. To change it to version 17, or whatever version you may have, we need to modify VSCode's configurations to point to Corretto 17.
151
153
152
154
- Get the path to Amazon Corretto. From your home directory, list the available JVMs:
@@ -166,9 +168,9 @@ You may notice that when you run the script above, the default JDK 11 is used in
166
168
```
167
169
- The path we want is `/usr/lib/jvm/java-17-amazon-corretto`.
168
170
- Open `settings.json` from the command pallette in VS Code by pressing "Ctrl + Shift + P".
169
-

171
+

0 commit comments