Once you have this sample opened, you'll be able to work with it like you would locally.
Some things to try:
-
Edit:
- Open
src/main/java/com/mycompany/app/App.java. - Try adding some code and check out the language features.
- Make a spelling mistake and notice it is detected. The Code Spell Checker extension was automatically installed because it is referenced in
.devcontainer/devcontainer.json. - Also notice that the Extension Pack for Java is installed. The JDK is in the
mcr.microsoft.com/devcontainers/javaimage and Dev Container settings and metadata are automatically picked up from image labels.
- Open
-
Terminal: Press Ctrl+Shift+` and type
unameand other Linux commands from the terminal window. -
Build, Run, and Debug:
- Open
src/main/java/com/mycompany/app/App.java. - Add a breakpoint.
- Press F5 to launch the app in the container.
- Once the breakpoint is hit, try hovering over variables, examining locals, and more.
- Open
-
Run a Test:
- Open
src/test/java/com/mycompany/app/AppTest.java. - Put a breakpoint in a test.
- Click the
Debug Testin the Code Lens above the function and watch it hit the breakpoint.
- Open
-
Install Node.js using a Dev Container Feature:
- Press F1 and select the Dev Containers: Configure Container Features... or Codespaces: Configure Container Features... command.
- Type "node" in the text box at the top.
- Check the check box next to "Node.js (via nvm) and yarn" (published by devcontainers)
- Click OK
- Press F1 and select the Dev Containers: Rebuild Container or Codespaces: Rebuild Container command so the modifications are picked up.