diff --git a/README.md b/README.md index 4e5f65e..eb7bed1 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,27 @@ [![License](https://img.shields.io/github/license/oracle/javavscode?style=for-the-badge&logo=apache)](https://github.com/oracle/javavscode/blob/main/LICENSE.txt) 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. + + ## Getting Started -1. Setting up the JDK +1. VS Code Tips + - To install and update extensions refer to [extensions](https://code.visualstudio.com/docs/getstarted/extensions). + - Search for a command by opening the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and typing the keywords. + - Keyboard Shortcut: + - Windows/Linux: `Ctrl+Shift+P` + - macOS: `Shift+Command+P` + - Type `>` in the search bar at the top. + - User input box opens at the top whenever input is required. +2. Setting up the JDK - 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. - - 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. + - 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. - The extension requires JDK 17 or newer to run. - - Optionally, set a different JDK to compile and run projects in the `View | Command Palette | Preferences: Open User Settings | Jdk › Project: Jdkhome` setting. + - Optionally, set a different JDK to compile and run projects in the `Open Settings | Jdk › Project: Jdkhome` setting. - By default, the __jdk.jdkhome__ setting is used. - Projects can run on JDK 8 and above. - For more information, see the section [Selecting the JDK](#selecting-the-jdk). -4. Use any one of the following ways to start coding, compiling and debugging in Java. - - Simply create a new Java class with `public static void main(String[] args)` method. +3. Use any one of the following ways to start coding, compiling and debugging in Java. + - Simply create a new Java class with `main` method. - Use the __Java: New File from Template...__ command to create a new Java file. - Use the __Java: New Project...__ command to create a new project. - 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 * Experience interactive coding with Java notebooks. Use the __Java: Create New Notebook...__ command to create a new Java notebook(`.ijnb` file) ![Java Notebook](vscode/images/java_notebook.gif) + * Add code snippets with `+ Code` button and document with markdown cells with `+ Markdown`. + * Double click on a cell to edit and hit `Esc` when done. * Jupyter-style notebooks let you combine Java code snippets with markdown-formatted text cells. * Run individual code cells or execute the entire notebook. - * Save outputs alongside code cells. + * Can save outputs alongside code cells. * Sharing notebooks * Share as `.ijnb` files for use with Oracle Java extension. * Rename with `.ipynb` for viewing in other IDEs Jupyter etc. @@ -176,24 +188,24 @@ Move members refactoring provides dedicated form as well. ## Formatter Preferences Easily update default formatter preferences by adjusting a simple configuration option to tailor settings according to specific needs. -Go to VSCode `View | Command Palette | Preferences:Open User Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file. +Go to VSCode `Open Settings | Extensions | Java` and set `Jdk › Format: Settings Path:` option to the formatter preferences file. Please refer to [Java formatting preferences](https://github.com/oracle/javavscode/wiki/Java-formatting-preferences) wiki for more info. ## Hints Preferences Easily update default hint preferences by adjusting a simple configuration option to tailor hint preferences to specific needs. -Go to VSCode `View | Command Palette | Preferences:Open User Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file. +Go to VSCode `Open Settings | Extensions | Java` and set `Jdk › Hints: Preferences:` option to the xml hint preferences file. ## Organize Imports 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. -Go to VSCode `View | Command Palette | Preferences:Open User Settings | Extensions | Java` and search for _Jdk_ to set `Jdk > Java > Imports:` options: +Go to VSCode `Open Settings | Extensions | Java` and search for _Jdk_ to set `Jdk > Java > Imports:` options: * `Count For Using Star Import` - Class count to use a star-import, 999 is the default value * `Count For Using Static Star Import` - Members count to use a static star-import, 999 is the default value * `Groups` - Groups of import statements (specified by their package prefixes) and their sorting order. Import statements within a group are ordered alphabetically -And `View | Command Palette | Preferences:Open User Settings | Extensions > Java > On Save: Organize Imports` - Enable organize imports action on a document save +And `Open Settings | Extensions > Java > On Save: Organize Imports` - Enable organize imports action on a document save ## JavaDoc smart editing 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. ## How to use JDK early access builds This setup makes it easier to experiment with early access JDK builds. Follow these steps to enable the use of an early access JDK: -Step-1: Navigate to `View | Command Palette | Preferences:Open User Settings | Jdk > Advanced > Disable: Nbjavac` and enable the checkbox. +Step-1: Navigate to `Open Settings | Jdk > Advanced > Disable: Nbjavac` and enable the checkbox. -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. +Step-2: Set the JDK in `Open Settings | Jdk: Jdkhome` to point to the early access JDK path. ## Troubleshooting 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`. diff --git a/vscode/images/java_notebook.gif b/vscode/images/java_notebook.gif index 2650d1a..a001c3f 100644 Binary files a/vscode/images/java_notebook.gif and b/vscode/images/java_notebook.gif differ diff --git a/vscode/images/jshell.gif b/vscode/images/jshell.gif index e98e293..1d86947 100644 Binary files a/vscode/images/jshell.gif and b/vscode/images/jshell.gif differ diff --git a/vscode/images/project_notebook.gif b/vscode/images/project_notebook.gif index 91633c4..9a1f467 100644 Binary files a/vscode/images/project_notebook.gif and b/vscode/images/project_notebook.gif differ