|
29 | 29 | [](https://github.com/oracle/javavscode/blob/main/LICENSE.txt) |
30 | 30 |
|
31 | 31 | 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. VS Code Tips |
| 36 | + - To install and update extensions refer to [extensions](https://code.visualstudio.com/docs/getstarted/extensions). |
| 37 | + - Search for a command by opening the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and typing the keywords. |
| 38 | + - Keyboard Shortcut: |
| 39 | + - Windows/Linux: `Ctrl+Shift+P` |
| 40 | + - macOS: `Shift+Command+P` |
| 41 | + - Type `>` in the search bar at the top. |
| 42 | + - User input box opens at the top whenever input is required. |
| 43 | +2. Setting up the JDK |
34 | 44 | - 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. |
| 45 | + - 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. |
36 | 46 | - 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. |
| 47 | + - Optionally, set a different JDK to compile and run projects in the `Open Settings | Jdk › Project: Jdkhome` setting. |
38 | 48 | - By default, the __jdk.jdkhome__ setting is used. |
39 | 49 | - Projects can run on JDK 8 and above. |
40 | 50 | - 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. |
| 51 | +3. Use any one of the following ways to start coding, compiling and debugging in Java. |
| 52 | + - Simply create a new Java class with `main` method. |
43 | 53 | - Use the __Java: New File from Template...__ command to create a new Java file. |
44 | 54 | - Use the __Java: New Project...__ command to create a new project. |
45 | 55 | - Open the folder with existing __Maven__ or __Gradle__ project files (_pom.xml_ or _build.gradle, gradle.properties_). |
@@ -70,9 +80,11 @@ Project Explorer provides an overview of logical project structure, groups sourc |
70 | 80 | * Experience interactive coding with Java notebooks. |
71 | 81 | Use the __Java: Create New Notebook...__ command to create a new Java notebook(`.ijnb` file) |
72 | 82 |  |
| 83 | + * Add code snippets with `+ Code` button and document with markdown cells with `+ Markdown`. |
| 84 | + * Double click on a cell to edit and hit `Esc` when done. |
73 | 85 | * Jupyter-style notebooks let you combine Java code snippets with markdown-formatted text cells. |
74 | 86 | * Run individual code cells or execute the entire notebook. |
75 | | - * Save outputs alongside code cells. |
| 87 | + * Can save outputs alongside code cells. |
76 | 88 | * Sharing notebooks |
77 | 89 | * Share as `.ijnb` files for use with Oracle Java extension. |
78 | 90 | * Rename with `.ipynb` for viewing in other IDEs Jupyter etc. |
@@ -176,24 +188,24 @@ Move members refactoring provides dedicated form as well. |
176 | 188 | ## Formatter Preferences |
177 | 189 | Easily update default formatter preferences by adjusting a simple configuration option to tailor settings according to specific needs. |
178 | 190 |
|
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. |
| 191 | +Go to VSCode `Open Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file. |
180 | 192 |
|
181 | 193 | Please refer to [Java formatting preferences](https://github.com/oracle/javavscode/wiki/Java-formatting-preferences) wiki for more info. |
182 | 194 |
|
183 | 195 | ## Hints Preferences |
184 | 196 | Easily update default hint preferences by adjusting a simple configuration option to tailor hint preferences to specific needs. |
185 | 197 |
|
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. |
| 198 | +Go to VSCode `Open Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file. |
187 | 199 |
|
188 | 200 | ## Organize Imports |
189 | 201 | 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 | 202 |
|
191 | | -Go to VSCode `View | Command Palette | Preferences:Open User Settings | Extensions | Java` and search for _Jdk_ to set `Jdk > Java > Imports:` options: |
| 203 | +Go to VSCode `Open Settings | Extensions | Java` and search for _Jdk_ to set `Jdk > Java > Imports:` options: |
192 | 204 | * `Count For Using Star Import` - Class count to use a star-import, 999 is the default value |
193 | 205 | * `Count For Using Static Star Import` - Members count to use a static star-import, 999 is the default value |
194 | 206 | * `Groups` - Groups of import statements (specified by their package prefixes) and their sorting order. Import statements within a group are ordered alphabetically |
195 | 207 |
|
196 | | -And `View | Command Palette | Preferences:Open User Settings | Extensions > Java > On Save: Organize Imports` - Enable organize imports action on a document save |
| 208 | +And `Open Settings | Extensions > Java > On Save: Organize Imports` - Enable organize imports action on a document save |
197 | 209 |
|
198 | 210 | ## JavaDoc smart editing |
199 | 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. |
@@ -222,9 +234,9 @@ As soon as one of the settings is changed, the Language Server is restarted. |
222 | 234 |
|
223 | 235 | ## How to use JDK early access builds |
224 | 236 | 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. |
| 237 | +Step-1: Navigate to `Open Settings | Jdk > Advanced > Disable: Nbjavac` and enable the checkbox. |
226 | 238 |
|
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. |
| 239 | +Step-2: Set the JDK in `Open Settings | Jdk: Jdkhome` to point to the early access JDK path. |
228 | 240 |
|
229 | 241 | ## Troubleshooting |
230 | 242 | 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