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
[GraalVM Tools for Java](https://marketplace.visualstudio.com/items?itemName=oracle-labs-graalvm.graalvm) extension provides capabilities to manage GraalVM installations and its components in VS Code and locally.
17
+
[GraalVM Tools for Java](https://marketplace.visualstudio.com/items?itemName=oracle-labs-graalvm.graalvm) extension provides capabilities to manage GraalVM installations and its components in VS Code and/or locally.
18
18
The extension ships a GraalVM installation and configuration wizard.
19
19
You can conveniently set up the default Java runtime to GraalVM JDK which comes with both just-in-time ([Graal](../../../reference-manual/java/compiler.md)) and ahead-of-time ([Native Image](../../../reference-manual/native-image/README.md)) compilers, making VS Code a comfortable and convenient integrated environment.
20
20
21
21
The GraalVM Tools for Java in combination with the [GraalVM Tools for Micronaut](https://marketplace.visualstudio.com/items?itemName=oracle-labs-graalvm.micronaut) brings native support for the Micronaut framework in VS Code and opens many more possibilities for Java developers.
22
22
23
-
> Note: The extension is a Technology Preview, and the development team is actively working on further improvements to provide better usability for developers.
23
+
> Note: The extension is a Technology Preview. The development team is actively working on further improvements to provide better usability for developers.
24
24
25
25
## Extension Installation
26
26
27
27
To install the GraalVM Tools for Java extension in VS Code, do the following:
28
28
29
29
1. Navigate to Extensions in the Activity Bar.
30
30
2. Search for "GraalVM" in the search field.
31
-
3. Once found, click **Install**. That action will install the GraalVM Tools for Java extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=oracle-labs-graalvm.graalvm).
31
+
3. Once found, click **Install**. That action installs the GraalVM Tools for Java extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=oracle-labs-graalvm.graalvm).
32
32
4. Reload when required.
33
33
34
34
The extension depends on the [Apache NetBeans Language Server](https://marketplace.visualstudio.com/items?itemName=ASF.apache-netbeans-java). (VS Code installs it for you.)
35
-
When the extension (and its dependent) is installed, VS Code will display the **Gr** icon in the Activity Bar on the left.
35
+
When the extension (and its dependent) is installed, VS Code displays the **Gr** icon in the Activity Bar on the left.
36
36
37
37
## GraalVM Installation Wizard
38
38
@@ -42,8 +42,8 @@ To start, click the **Gr** icon in the Activity Bar. You can either add an exist
The **Download & Install GraalVM** action is recommended as it eliminates the fuss around setting up environment variables for you.
49
49
@@ -67,16 +67,16 @@ Follow these steps to download and install GraalVM Community Edition:
67
67
3. Pick one of the available Java versions.
68
68
4. Select the destination folder.
69
69
70
-
The installation will start immediately.
71
-
The wizard will download the package from [Github](https://github.com/graalvm/graalvm-ce-builds/releases) in the background and display progress.
70
+
The installation starts immediately.
71
+
The wizard downloads the package from [Github](https://github.com/graalvm/graalvm-ce-builds/releases) in the background and display progress.
72
72
73
-
Once the installation completes, the **Install Optional GraalVM Components** window will pop up prompting you to install additional language runtimes and utilities (Native Image, JavaScript, Node.js, LLVM, Python, Ruby, etc.) to the core package:
73
+
Once the installation completes, the **Install Optional GraalVM Components** window pops up prompting you to install additional language runtimes and utilities (Native Image, JavaScript, Node.js, LLVM, Python, Ruby, etc.) to the core package:
You are sent an email to verify your email address and accept the license.
98
98
@@ -102,21 +102,19 @@ Follow these steps to download and install GraalVM Enterprise:
102
102
103
103
8. Return to VS Code and press **Continue Download** to continue. Your download token is then generated and saved by default in the `.gu/config` file in user's home directory (you can update the storage location later, see below).
The installation wizard will download a package from Oracle's storage point.
108
+
The download and installation of GraalVM Enterprise starts.
109
+
The installation wizard downloads a package from Oracle's storage point.
112
110
113
111
If you clicked **Continue Download** without accepting the license, you would see the following warning:
114
112
115
-

113
+
<imgsrc="images/continue_download_not_accepted.png"alt="Continue Download without license acceptance"style="width: 50%;">
116
114
117
115
> Note: If your machine is behind a proxy, you must set your environment variables (`http_proxy`, `https_proxy`) appropriately. You can use the quick command **Setup Proxy**.
118
116
119
-
Once the installation completes, the **Install Optional GraalVM Components** window will pop up prompting you to install additional language runtimes and utilities (Native Image, JavaScript, Node.js, LLVM, Python, Ruby, etc.) to the core package. Once you confirm, you are taken to the selection list.
117
+
Once the installation completes, the **Install Optional GraalVM Components** window pops up prompting you to install additional language runtimes and utilities (Native Image, JavaScript, Node.js, LLVM, Python, Ruby, etc.) to the core package. Once you confirm, you are taken to the selection list.
120
118
Since you already have a download token and accepted the license, components will be installed without any additional interaction.
121
119
122
120
#### Show Current Download Configuration
@@ -126,11 +124,11 @@ Once copied you can re-use the download token, for example, (1) to install Graal
126
124
127
125
1. Go to **View**, then **Command Palette** and search for **GraalVM: Show GU Configuration**:
@@ -152,10 +150,10 @@ When the installation is complete, the **Set Default Java** action is invoked.
152
150
153
151
2. Select both **Set as JAVA for Terminal** options (`JAVA_HOME` and `PATH`) in the **Configure active GraalVM** window:
154
152
155
-

153
+
<imgsrc="images/set_as_java_for_terminal.png"alt="Set as JAVA for Terminal"style="width: 50%;">
156
154
157
155
Alternatively, you can invoke the same action from **View**, then **Command Palette** (use the `Ctrl+Shift+P` hot keys combination for Linux, and `Command+Shift+P` for macOS to open the commands palette), and search for "GraalVM".
158
-
You will see **GraalVM: Set Active GraalVM Installation** among other actions.
156
+
You see **GraalVM: Set Active GraalVM Installation** among other actions.
159
157
160
158
## Java Development and Debugging
161
159
@@ -171,10 +169,10 @@ If VS Code detects the Extension Pack for Java from Microsoft installed, it deac
171
169
The GraalVM Tools for Java extension provides integration with [VisualVM](https://visualvm.github.io), the all-in-one Java (and polyglot) monitoring and troubleshooting tool.
172
170
VisualVM brings powerful yet easy-to-use visual Java tooling to VS Code.
173
171
174
-
When you run a Java application, the process ID will be detected automatically and displayed in the **VISUALVM** pane.
172
+
When you run a Java application, the process ID is detected automatically and displayed in the **VISUALVM** pane.
175
173
Open VisualVM by just clicking the play button:
176
174
177
-

175
+
<imgsrc="images/open_visualvm.png"alt="VisualVM and VS Code Integration"style="width: 50%;">
178
176
179
177
For more information, see the [dedicated guide](visualvm-integration.md) how to start using VisualVM from within VS Code.
180
178
@@ -188,13 +186,13 @@ Thanks to [GraalVM Tools for Java](https://marketplace.visualstudio.com/items?it
188
186
189
187
GraalVM Tools for Java extension provides the **NATIVE IMAGE** with **Agent** pane to automate the process of tracking and registering dynamic feature calls, making it easier to configure and build a native executable in VS Code. The [tracing agent](../../../reference-manual/native-image/AutomaticMetadataCollection.md) tracks dynamic feature calls whilst your application is running on a JVM, and records those calls into JSON configuration files.
> Note: The **NATIVE IMAGE** pane will show up when you open your Java project in VS Code.
191
+
> Note: The **NATIVE IMAGE** pane shows up when you open your Java project in VS Code.
194
192
195
193
> Note: The support for the Native Image agent is experimental.
196
194
197
-
In the next section you will learn how to build a native executable of a Java application and apply the Tracing agent in VS code.
195
+
In the next section you learn how to build a native executable of a Java application and apply the Tracing agent in VS code.
198
196
199
197
### Building
200
198
@@ -203,9 +201,9 @@ To build a native executable of your Java application in VS Code, do the followi
203
201
1. Create the _launch.json_ file. If not already created, create a new file from the **Run and Debug** activity panel using the _create a launch.json file_ link. Select the **Java 8+ environment** when asked. Save the _launch.json_ file after editing it.
204
202
2. Enable the Tracing agent. Click **Gr** in the left sidebar and expand the **NATIVE IMAGE** pane. Expand **Agent** and click the edit button to configure its state.
205
203
206
-
Select **enabled** so the Native Image agent will start with the Java process:
204
+
Select **enabled** so the Native Image agent starts with the Java process:
> Note: The state is not remembered: if you close the VS Code window, it will change back to **disabled**.
211
209
@@ -236,19 +234,17 @@ If you use the Micronaut framework to create your Java project, you can build a
236
234
### Building Native Images on Windows
237
235
238
236
To use Native Image on Windows, you need Visual Studio Build Tools with Windows SDK installed.
239
-
The `native-image` builder will only work when it is executed from the **x64 Native Tools Command Prompt**. Check [this link](https://medium.com/graalvm/using-graalvm-and-native-image-on-windows-10-9954dc071311) for more details.
237
+
The `native-image` builder only works when it is executed from the **x64 Native Tools Command Prompt**. Check [this link](https://medium.com/graalvm/using-graalvm-and-native-image-on-windows-10-9954dc071311) for more details.
240
238
241
239
For Windows users, the extension provides a pre-configured x64 command prompt using Microsoft Developer Tools. Assuming you already have Visual Studio Build Tools with Windows SDK, GraalVM with Native Image installed, and opened your Java project in VS Code.
242
240
243
241
1. In the **NATIVE IMAGE** pane, click on right arrow, **>**:
244
242
245
-

246
-
247
-
It will open a dialog window asking you to selectan existing Windows SDK build tools configuration script (`vcvars64.bat`) from the default installation location, or to selecta custom configuration script. VS Code will detect the script and pre-populate the path:
243
+
<img src="images/ni_pane_windows.png" alt="NATIVE IMAGE page on Windows" style="width: 50%;">
248
244
249
-

245
+
It opens a dialog window asking you to selectan existing Windows SDK build tools configuration script (`vcvars64.bat`) from the default installation location, or to selecta custom configuration script. VS Code detects the script and pre-populate the path.
250
246
251
-
2. Click enter. A new Terminal window will open running inside the x64 native tools command prompt.
247
+
2. Click enter. A new Terminal window opens running inside the x64 native tools command prompt.
252
248
253
249
Note that the path to Windows SDK build tools is saved globally, so next time you open a New Terminal
254
250
from the **NATIVE IMAGE** pane, it will run inside the x64 native tools command prompt.
@@ -266,7 +262,7 @@ Learn more about GraalVM Native Image [here](../../../reference-manual/native-im
266
262
The GraalVM Tools forJava provide Java-like debugging of a native executablein a running state directly from within VS Code.
267
263
You can set breakpoints, inspect the state of your application, even attach the debugger to a native image process in VS Code and step over the Java application source code.
268
264
269
-

265
+
<img src="images/debugging_ni_vscode.png" alt="Native Image Debugging in VS Code">
270
266
271
267
> Note: To debug a native executable from within VS Code, you must install GraalVM Enterprise.
0 commit comments