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 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
+
32
34
## Getting Started
33
-
1. Setting up the JDK
35
+
1. See the [VS Code Tips](https://github.com/oracle/javavscode/wiki/VSCode-Tips) wiki for a quick primer on getting started with VS Code.
36
+
2. Setting up the JDK
34
37
- If no JDK is present in your system then the extension can set things up for you. For more details refer to [JDK Downloader](#jdk-downloader) section.
35
-
- Set the JDK in the `View | Command Palette | Preferences: Open User Settings | Jdk: Jdkhome` setting to point to the JDK that the Language Server will run on and also by default use for running and compiling projects.
38
+
- Set the VS Code `Settings | Jdk: Jdkhome` setting to point to the JDK that the Language Server will run on and also by default use for running and compiling projects.
36
39
- The extension requires JDK 17 or newer to run.
37
-
- Optionally, set a different JDK to compile and run projects in the `View | Command Palette | Preferences: Open User Settings | Jdk › Project: Jdkhome` setting.
40
+
- Optionally, set a different JDK to compile and run projects in the `Settings | Jdk › Project: Jdkhome` setting.
38
41
- By default, the __jdk.jdkhome__ setting is used.
39
42
- Projects can run on JDK 8 and above.
40
43
- For more information, see the section [Selecting the JDK](#selecting-the-jdk).
41
-
4. Use any one of the following ways to start coding, compiling and debugging in Java.
42
-
- Simply create a new Java class with `public static void main(String[] args)` method.
44
+
3. Use any one of the following ways to start coding, compiling and debugging in Java.
45
+
- Simply create a new Java class with `main` method.
43
46
- Use the __Java: New File from Template...__ command to create a new Java file.
44
47
- Use the __Java: New Project...__ command to create a new project.
45
48
- Open the folder with existing __Maven__ or __Gradle__ project files (_pom.xml_ or _build.gradle, gradle.properties_).
@@ -67,38 +70,40 @@ Project Explorer provides an overview of logical project structure, groups sourc
67
70
68
71
## Interactive Java Notebooks
69
72
### Introduction
70
-
* Experience interactive coding with Java notebooks.
71
-
Use the __Java: Create New Notebook...__ command to create a new Java notebook(`.ijnb` file)
72
-

73
-
* Jupyter-style notebooks let you combine Java code snippets with markdown-formatted text cells.
74
-
* Run individual code cells or execute the entire notebook.
75
-
* Save outputs alongside code cells.
76
-
* Sharing notebooks
73
+
* Experience interactive coding with Java notebooks. See the [Using Interactive Java Notebooks](https://github.com/oracle/javavscode/wiki/Interactive-Java-Notebooks) wiki for guidance and tutorials on using notebooks.
74
+
* Use the __Java: Create New Notebook...__ command to create a new Java notebook(`.ijnb` file)<br/>
75
+

76
+
* Add code snippets with `+ Code` button and document with markdown cells with `+ Markdown`.
77
+
* Double click on a cell to edit and hit `Esc` when done.
78
+
* Jupyter-style notebooks let you combine Java code snippets with markdown-formatted text cells.
79
+
* Run individual code cells or execute the entire notebook.
80
+
* Can save outputs alongside code cells.
81
+
* Sharing notebooks
77
82
* Share as `.ijnb` files for use with Oracle Java extension.
78
83
* Rename with `.ipynb` for viewing in other IDEs Jupyter etc.
79
-
* Download the [sample notebooks](https://github.com/oracle/javavscode/blob/main/samples/notebooks) and open in VSCode to get started.
84
+
* Download the [sample notebooks](https://github.com/oracle/javavscode/blob/main/samples/notebooks) and open in VS Code to get started.
80
85
81
86
### Java Notebooks for Java Projects
82
-
* Document Java projects with interactive Java notebooks.
83
-
* Open/Create a Java notebook in your workspace folder loaded with classes from your project.
87
+
* Document Java projects with interactive Java notebooks.
88
+
* Open/Create a Java notebook in your workspace folder loaded with classes from your project.<br/>
84
89

85
-
* Use `Project Context` options incase you want to change to a different project context .
Class level refactorings as well as variable refactorings are supported in VSCode via Oracle Java Platform extension. See following screenshots:
137
+
Class level refactorings as well as variable refactorings are supported in VS Code via the Oracle Java Platform extension. See the following screenshots:
@@ -176,36 +181,36 @@ Move members refactoring provides dedicated form as well.
176
181
## Formatter Preferences
177
182
Easily update default formatter preferences by adjusting a simple configuration option to tailor settings according to specific needs.
178
183
179
-
Go to VSCode `View | Command Palette | Preferences:Open User Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file.
184
+
Open VS Code `Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file.
180
185
181
186
Please refer to [Java formatting preferences](https://github.com/oracle/javavscode/wiki/Java-formatting-preferences) wiki for more info.
182
187
183
188
## Hints Preferences
184
189
Easily update default hint preferences by adjusting a simple configuration option to tailor hint preferences to specific needs.
185
190
186
-
Go to VSCode `View | Command Palette | Preferences:Open User Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file.
191
+
Open VS Code `Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file.
187
192
188
193
## Organize Imports
189
194
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.
190
195
191
-
Go to VSCode `View | Command Palette | Preferences:Open User Settings | Extensions | Java`and search for _Jdk_ to set `Jdk > Java > Imports:` options:
196
+
Open VS Code `Settings | Extensions | Java` and search for _Jdk_ to set `Jdk › Java › Imports:` options:
192
197
*`Count For Using Star Import` - Class count to use a star-import, 999 is the default value
193
198
*`Count For Using Static Star Import` - Members count to use a static star-import, 999 is the default value
194
199
*`Groups` - Groups of import statements (specified by their package prefixes) and their sorting order. Import statements within a group are ordered alphabetically
195
200
196
-
And `View | Command Palette | Preferences:Open User Settings | Extensions > Java > On Save: Organize Imports` - Enable organize imports action on a document save
201
+
The `Jdk › Java › On Save: Organize Imports` setting in VS Code `Settings | Extensions | Java` enables the **Organize Imports** action to run when saving a document.
197
202
198
203
## JavaDoc smart editing
199
-
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.
204
+
When adding JavaDoc to code Oracle Java 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.
200
205

201
206
202
207
## Test Explorer
203
-
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.
208
+
Oracle Java 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.
204
209

205
210
206
211
### Localization support
207
-
Oracle Java Platform extension provides localization support for _Japanese_ and _Simplified Chinese_.
208
-
To switch language `Go to command Palette->Configure display language` select `ja` for _Japanese_ or `zh-cn` for _Simplified Chinese_
212
+
Oracle Java extension provides localization support for _Japanese_ and _Simplified Chinese_.
213
+
Use the `View | Command Palette | Configure Display Language` command to select `ja` for _Japanese_ or `zh-cn` for _Simplified Chinese_
@@ -222,9 +227,8 @@ As soon as one of the settings is changed, the Language Server is restarted.
222
227
223
228
## How to use JDK early access builds
224
229
This setup makes it easier to experiment with early access JDK builds. Follow these steps to enable the use of an early access JDK:
225
-
Step-1: Navigate to `View | Command Palette | Preferences:Open User Settings | Jdk > Advanced > Disable: Nbjavac` and enable the checkbox.
226
-
227
-
Step-2: Set the JDK in `View | Command Palette | Preferences:Open User Settings (JSON) ...` by updating the __jdk.jdkhome__ setting to point to the early access JDK path.
230
+
1. Open VS Code `Settings | Jdk › Advanced › Disable: Nbjavac` and enable the checkbox.
231
+
2. Set `Settings | Jdk: Jdkhome` to point to the home-folder path of the early access JDK.
228
232
229
233
## Troubleshooting
230
234
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`.
0 commit comments