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
Java Platform extension from Oracle brings fullfeatured development support (edit-compile-debug & test cycle) to VS Code. It also offers support for Maven and Gradle projects. Applications using JDK 8 and above are supported.
32
+
Java Platform extension from Oracle brings full-featured development support (edit-compile-debug & test cycle) to VS Code. It also offers support for Maven and Gradle projects. Applications using JDK 8 and above are supported.
32
33
33
34
34
35
## Getting Started
35
36
1. VS Code Tips
36
-
- To install and update extensions refer to [extensions](https://code.visualstudio.com/docs/getstarted/extensions).
37
+
- To install and update extensions, refer to [Use extensions in Visual Studio Code](https://code.visualstudio.com/docs/getstarted/extensions).
37
38
- Search for a command by opening the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and typing the keywords.
38
39
- Keyboard Shortcut:
39
40
- Windows/Linux: `Ctrl+Shift+P`
@@ -46,7 +47,7 @@ Java Platform extension from Oracle brings full featured development support (ed
46
47
- The extension requires JDK 17 or newer to run.
47
48
- Optionally, set a different JDK to compile and run projects in the `Open Settings | Jdk › Project: Jdkhome` setting.
48
49
- By default, the __jdk.jdkhome__ setting is used.
49
-
- Projects can run on JDK 8 and above.
50
+
- Projects can run on JDK 8 and above.
50
51
- For more information, see the section [Selecting the JDK](#selecting-the-jdk).
51
52
3. Use any one of the following ways to start coding, compiling and debugging in Java.
52
53
- Simply create a new Java class with `main` method.
@@ -55,67 +56,67 @@ Java Platform extension from Oracle brings full featured development support (ed
55
56
- Open the folder with existing __Maven__ or __Gradle__ project files (_pom.xml_ or _build.gradle, gradle.properties_).
56
57
57
58
## Supported Actions
58
-
In the VS Code command palette:
59
+
In the VS Code command palette:
59
60
*__Java: New Project...__ allows creation of new Maven or Gradle project
60
-
*__Java: New File from Template...__add various files to currently selected open project. Files are:
61
+
*__Java: New File from Template...__adds various files to the currently selected open project. Files are:
61
62
* Java - broad selection of various predefined Java classes
62
63
* Unit tests - JUnit and TestNG templates for test suites and test cases
63
64
* Other - various templates for Javascript, JSON, YAML, properties, ... files
64
-
*__Java: Create New Notebook...__ command to create a new [Java notebook](#interactive-java-notebooks)(`.ijnb` file)
65
-
*__Java: Open JShell...__command to open [JShell](#jshell).
65
+
*__Java: Create New Notebook...__ command to create a new [Java notebook](#interactive-java-notebooks)(`.ijnb` file)
66
+
*__Java: Open JShell...__ command to open [JShell](#jshell).
66
67
*__Java: Compile Workspace__ - invoke Maven or Gradle build
67
-
*__Java: Clean Workspace__ - clean Maven or Gradle build
68
+
*__Java: Clean Workspace__ - clean Maven or Gradle buildc
68
69
*__Download, install and Use JDK__ - allows download and installation of JDK binaries
69
70
* Debugger __Java+...__ - start main class or test on selected JDK. More in [Debugger section](#debugger-and-launch-configurations)
70
71
*__Test Explorer__ for Java tests results visualization and execution including editor code Lenses.
71
72
* Maven and Gradle support including multi-project projects, subprojects opening and Gradle priming builds.
72
73
*__Java: Go To Test/Tested Class__ - Navigates to the corresponding test or source class file
73
74
74
75
## Project Explorer
75
-
Project Explorer provides an overview of logical project structure, groups sources together and greatly simplifies Java package structure exploration. Project Explorer is an addition to the classical workspace explorer. Use it to build, test, execute and operate your Maven and Gradle Java projects.
76
+
Project Explorer provides an overview of logical project structure, groups sources together and greatly simplifies Java package structure exploration. Project Explorer is an addition to the classical workspace explorer. Use it to build, test, execute and operate your Maven and Gradle Java projects.
*__Launch Java App__ - Debug or Run current Java project
@@ -127,14 +128,15 @@ Language Server __Java+ ...__ launch configuration supports debugging and runnin
127
128
Default launch configurations provided by Language Server can modified in `launch.json` file.
128
129
129
130
### Run Configurations panel
130
-
Program arguments, VM options, environment variables,... can be set in Run Configuration panel a part of Explorer. The panel is sufficient for all typical use-cases Java programmer faces. Only advanced, expert scenarios may require touching of `launch.json` (which still takes precedence).
131
+
Program arguments, VM options, environment variables, etc., can be set in the Run Configuration panel as part of Explorer. The panel is sufficient for all typical use-cases Java programmer faces. Only advanced, expert scenarios may require touching of `launch.json` (which still takes precedence).
If the system does not detect any JDK, the extension will offer a downloader and setup prompt to help you set up a JDK. This setup provides options for Oracle JDK, OpenJDK, and allows you to choose from any installed JDK on your system.
135
136
Alternatively, you can manually specify the path to JDK binaries by utilizing the JDK downloader.
136
-
You can also access the JDK downloader through the "Download, install, and Use JDK" option in the command palette.
Move members refactoring provides dedicated form as well.
169
+
Move members refactoring provides dedicated form as well.
168
170

169
171
170
172
### Some of supported refactorings:
@@ -186,37 +188,37 @@ Move members refactoring provides dedicated form as well.
186
188
* Constructor and method argument refactoring
187
189
188
190
## Formatter Preferences
189
-
Easily update default formatter preferences by adjusting a simple configuration option to tailor settings according to specific needs.
191
+
Easily update default formatter preferences by adjusting a simple configuration option to tailor settings according to specific needs.
190
192
191
-
Go to VSCode `Open Settings | Extensions | Java`and set `Jdk › Format: Settings Path:` option to the formatter preferences file.
193
+
Go to VSCode `Open Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file.
192
194
193
195
Please refer to [Java formatting preferences](https://github.com/oracle/javavscode/wiki/Java-formatting-preferences) wiki for more info.
194
196
195
197
## Hints Preferences
196
198
Easily update default hint preferences by adjusting a simple configuration option to tailor hint preferences to specific needs.
197
199
198
-
Go to VSCode `Open Settings | Extensions | Java`and set `Jdk › Hints: Preferences:` option to the xml hint preferences file.
200
+
Go to VSCode `Open Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file.
199
201
200
202
## Organize Imports
201
203
Out of the box support for organizing imports in Java sources is available. It removes unused imports, groups imports by packages and updates your imports whenever a file is saved. In addition to the defaults, there is a rich set of configuration options.
202
204
203
-
Go to VSCode `Open Settings | Extensions | Java`and search for _Jdk_ to set `Jdk > Java > Imports:` options:
205
+
Go to VSCode `Open Settings | Extensions | Java` and search for _Jdk_ to set `Jdk > Java > Imports:` options:
204
206
*`Count For Using Star Import` - Class count to use a star-import, 999 is the default value
205
207
*`Count For Using Static Star Import` - Members count to use a static star-import, 999 is the default value
206
208
*`Groups` - Groups of import statements (specified by their package prefixes) and their sorting order. Import statements within a group are ordered alphabetically
207
209
208
210
And `Open Settings | Extensions > Java > On Save: Organize Imports` - Enable organize imports action on a document save
209
211
210
212
## JavaDoc smart editing
211
-
When adding JavaDoc to code Oracle Java Platform extension assists by suggesting to insert preformatted and prepopulated JavaDoc comment. Type `/**` above method signature and IDE offers to complete the JavaDoc. The action creates JavaDoc comment with all arguments prepared.
213
+
When adding JavaDoc to code Oracle Java Platform extension assists by suggesting to insert preformatted and prepopulated JavaDoc comment. Type `/**` above method signature and IDE offers to complete the JavaDoc. The action creates JavaDoc comment with all arguments prepared.
212
214

213
215
214
216
## Test Explorer
215
-
Oracle Java Platform extension provides Test Explorer view which allows to run all tests in a project, examine the results, go to source code and run particular test.
217
+
Oracle Java Platform extension provides Test Explorer view which allows to run all tests in a project, examine the results, go to source code and run particular test.
216
218

217
219
218
220
### Localization support
219
-
Oracle Java Platform extension provides localization support for _Japanese_ and _Simplified Chinese_.
221
+
Oracle Java Platform extension provides localization support for _Japanese_ and _Simplified Chinese_.
220
222
To switch language `Go to command Palette->Configure display language` select `ja` for _Japanese_ or `zh-cn` for _Simplified Chinese_
221
223
222
224
@@ -236,19 +238,19 @@ As soon as one of the settings is changed, the Language Server is restarted.
236
238
This setup makes it easier to experiment with early access JDK builds. Follow these steps to enable the use of an early access JDK:
237
239
Step-1: Navigate to `Open Settings | Jdk > Advanced > Disable: Nbjavac` and enable the checkbox.
238
240
239
-
Step-2: Set the JDK in `Open Settings | Jdk: Jdkhome`to point to the early access JDK path.
241
+
Step-2: Set the JDK in `Open Settings | Jdk: Jdkhome` to point to the early access JDK path.
240
242
241
243
## Troubleshooting
242
244
If your extension is not starting and throwing some error like no JDK found even if you have a working JDK installed in your machine, then you can try deleting cache for the workspace using `View | Command Palette | Delete oracle java extension cache for this workspace`.
243
245
244
246
## Workspace
245
247
The extension will analyze the content of the opened workspace, and relevant other files. If the workspace contains a lot of data, this may take a long time. It is therefore recommended to avoid adding unnecessarily big folders in a workspace. Specifically, it is not recommended to open user's home directory as a part of the workspace.
246
248
247
-
## Known Issue
249
+
## Known Issues
248
250
1. If an action has been applied to the Maven `pom.xml` file through the extension, such as enabling a preview feature or adding a test runner framework, subsequent compile or run operations may fail. To resolve this issue, please follow the steps below:
249
251
1. Check the `pom.xml` file for any duplicated tags.
250
252
2. If duplicated tags are found, remove the extra tags and attempt to compile again.
251
-
3. Add the `--enable-preview` VM argument to the *exec-maven-plugin* or *maven-surefile-plugin* configurations if they are used execution or test runs.
253
+
3. Add the `--enable-preview` VM argument to the *exec-maven-plugin* or *maven-surefile-plugin* configurations if they are used for execution or test runs.
252
254
2. The *Project: Test Project* command executes the project's tests but does not update the Testing or the Tests Results panels. The test output is present only in the Terminal or Debug Console panel.
253
255
254
256
## Telemetry
@@ -277,5 +279,5 @@ Please consult the [security guide](https://github.com/oracle/javavscode/blob/ma
277
279
278
280
Copyright (c) 2023-2025 Oracle and/or its affiliates.
279
281
280
-
Oracle Java Platform Extension for Visual Studio Code is licensed under [Apache 2.0 License](https://github.com/oracle/javavscode/blob/main/LICENSE.txt).
282
+
Oracle Java Platform Extension for Visual Studio Code is licensed under [Apache 2.0 License](https://github.com/oracle/javavscode/blob/main/LICENSE.txt).
281
283
The [THIRD_PARTY_LICENSES](./THIRD_PARTY_LICENSES.txt) file contains third party notices and licenses.
0 commit comments