Skip to content

metcalfc/java-example

 
 

Repository files navigation

Try Out Daytona: Java

Open in Dev Containers

Things to try

Once you have this sample opened, you'll be able to work with it like you would locally.

Some things to try:

  1. 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/java image and Dev Container settings and metadata are automatically picked up from image labels.
  2. Terminal: Press Ctrl+Shift+` and type uname and other Linux commands from the terminal window.

  3. 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.
  4. Run a Test:

    • Open src/test/java/com/mycompany/app/AppTest.java.
    • Put a breakpoint in a test.
    • Click the Debug Test in the Code Lens above the function and watch it hit the breakpoint.
  5. 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.

About

Java sample project for trying out Daytona

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%