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: README.md
+47-55Lines changed: 47 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,21 +33,14 @@ Java Platform extension from Oracle brings full-featured development support (ed
33
33
34
34
35
35
## Getting Started
36
-
1. VS Code Tips
37
-
- To install and update extensions, refer to [Use extensions in Visual Studio Code](https://code.visualstudio.com/docs/getstarted/extensions).
38
-
- Search for a command by opening the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and typing the keywords.
39
-
- Keyboard Shortcut:
40
-
- Windows/Linux: `Ctrl+Shift+P`
41
-
- macOS: `Shift+Command+P`
42
-
- Type `>` in the search bar at the top.
43
-
- User input box opens at the top whenever input is required.
36
+
1. See the [VS Code Tips](https://github.com/oracle/javavscode/wiki/VS-Code-Tips) wiki for a quick primer on getting started with VS Code.
44
37
2. Setting up the JDK
45
38
- 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.
46
-
- Set the JDK in the `Open 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.
39
+
- 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.
47
40
- The extension requires JDK 17 or newer to run.
48
-
- Optionally, set a different JDK to compile and run projects in the `Open Settings | Jdk › Project: Jdkhome` setting.
41
+
- Optionally, set a different JDK to compile and run projects in the `Settings | Jdk › Project: Jdkhome` setting.
49
42
- By default, the __jdk.jdkhome__ setting is used.
50
-
- Projects can run on JDK 8 and above.
43
+
- Projects can run on JDK 8 and above.
51
44
- For more information, see the section [Selecting the JDK](#selecting-the-jdk).
52
45
3. Use any one of the following ways to start coding, compiling and debugging in Java.
53
46
- Simply create a new Java class with `main` method.
@@ -73,30 +66,31 @@ In the VS Code command palette:
73
66
*__Java: Go To Test/Tested Class__ - Navigates to the corresponding test or source class file
74
67
75
68
## Project Explorer
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.
69
+
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.<br/>
* Experience interactive coding with Java notebooks. Use the __Java: Create New Notebook...__ command to create a new Java notebook (`.ijnb` file)
74
+
* 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.
75
+
* Use the __Java: Create New Notebook...__ command to create a new Java notebook (`.ijnb` file)<br/>
82
76

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

97
-
* Use the `Project Context` options to switch to a different project context.
*__Launch Java App__ - Debug or Run current Java project
123
117
*__Attach to Port__ & __Attach to Process__ - Attach debugger actions. Available when __Java+ ...__ at the bottom of drop down list is selected.
124
-
* Select this configuration, then click the 
118
+
* Select this configuration, then click the button.
125
119
* Select either from available process or enter the port to connect to JVM running with JDWP.
126
120
*__Attach to Shared Memory__ is available on Windows in addition to above mentioned _Attach..._
127
121
128
122
Default launch configurations provided by Language Server can modified in `launch.json` file.
129
123
130
124
### Run Configurations panel
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).
125
+
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).<br/>
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.
136
130
Alternatively, you can manually specify the path to JDK binaries by utilizing the JDK downloader.
137
-
You can also access the JDK downloader through the "Download, install, and Use JDK" option in the command palette.
138
-

131
+
You can also access the JDK downloader through the "Download, install, and Use JDK" option in the command palette.<br/>
Class level refactorings as well as variable refactorings are supported in VS Code via Oracle Java Platform extension. See following screenshots:
140
+
Class level refactorings as well as variable refactorings are supported in VS Code via the Oracle Java Platform extension. See the following screenshots:
Move members refactoring provides dedicated form as well.
162
+
Move members refactoring provides dedicated form as well.<br/>
170
163

171
164
172
-
### Some of supported refactorings:
165
+
### Some other supported refactorings are:
173
166
* Convert to static import
174
167
* Pull member up & down
175
168
* Move class
@@ -180,46 +173,46 @@ Move members refactoring provides dedicated form as well.
180
173
* Generate hashCode/equals
181
174
* Generate toString()
182
175
* Surround With refactoring
183
-
*For cycle refactoring
184
-
* try-catch refactoring
185
-
* switch() statement
186
-
* while() cycle
176
+
*`for` cycle refactoring
177
+
*`try-catch` refactoring
178
+
*`switch()` statement
179
+
*`while()` cycle
187
180
* Inline redundant variable
188
181
* Constructor and method argument refactoring
189
182
190
183
## Formatter Preferences
191
-
Easily update default formatter preferences by adjusting a simple configuration option to tailor settings according to specific needs.
184
+
Easily update default formatter preferences by adjusting a simple configuration option to tailor settings according to specific needs.
192
185
193
-
Go to VS Code `Open Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file.
186
+
Open VS Code `Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file.
194
187
195
188
Please refer to [Java formatting preferences](https://github.com/oracle/javavscode/wiki/Java-formatting-preferences) wiki for more info.
196
189
197
190
## Hints Preferences
198
191
Easily update default hint preferences by adjusting a simple configuration option to tailor hint preferences to specific needs.
199
192
200
-
Go to VS Code `Open Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file.
193
+
Open VS Code `Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file.
201
194
202
195
## Organize Imports
203
196
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.
204
197
205
-
Go to VS Code `Open Settings | Extensions | Java` and search for _Jdk_ to set `Jdk > Java > Imports:` options:
198
+
Open VS Code `Settings | Extensions | Java` and search for _Jdk_ to set `Jdk › Java › Imports:` options:
206
199
*`Count For Using Star Import` - Class count to use a star-import, 999 is the default value
207
200
*`Count For Using Static Star Import` - Members count to use a static star-import, 999 is the default value
208
201
*`Groups` - Groups of import statements (specified by their package prefixes) and their sorting order. Import statements within a group are ordered alphabetically
209
202
210
-
And `Open Settings | Extensions > Java > On Save: Organize Imports`- Enable organize imports action on a document save
203
+
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.
211
204
212
205
## JavaDoc smart editing
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.
206
+
When adding JavaDoc to code Oracle Java Platform extension assists by suggesting to insert preformatted and prepopulated JavaDoc comment. Type `/**` above the method signature and the IDE offers to complete the JavaDoc. The action creates a JavaDoc comment with all the parameters prepared.<br/>
214
207

215
208
216
209
## Test Explorer
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.
210
+
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.<br/>
218
211

219
212
220
213
### Localization support
221
214
Oracle Java Platform extension provides localization support for _Japanese_ and _Simplified Chinese_.
222
-
To switch language `Go to command Palette->Configure display language` select `ja` for _Japanese_ or `zh-cn` for _Simplified Chinese_
215
+
Use the `View | Command Palette | Configure Display Language` command to select `ja` for _Japanese_ or `zh-cn` for _Simplified Chinese_
@@ -236,12 +229,11 @@ As soon as one of the settings is changed, the Language Server is restarted.
236
229
237
230
## How to use JDK early access builds
238
231
This setup makes it easier to experiment with early access JDK builds. Follow these steps to enable the use of an early access JDK:
239
-
Step-1: Navigate to `Open Settings | Jdk > Advanced > Disable: Nbjavac` and enable the checkbox.
240
-
241
-
Step-2: Set the JDK in `Open Settings | Jdk: Jdkhome` to point to the early access JDK path.
232
+
1. Open VS Code `Settings | Jdk › Advanced › Disable: Nbjavac` and enable the checkbox.
233
+
2. Set `Settings | Jdk: Jdkhome` to point to the home-folder path of the early access JDK.
242
234
243
235
## Troubleshooting
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`.
236
+
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`.
245
237
246
238
## Workspace
247
239
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.
0 commit comments