Skip to main content

Part A: One-Time Global WSL Configuration

1. Enable & initialize WSL 2

Reboot if prompted. Launch your Linux distro (e.g. Ubuntu) and complete its first-run setup.

2. Hide Windows ADS files globally

Restart your distro—Windows alternate-data-streams (*:Zone.Identifier) will no longer appear.

3. Configure your shell environment


Part B: Install Tooling & Tomcat in WSL

4. Install core tools

5. Install Tomcat 9.0.85

6. Verify Tomcat

Open your Windows browser to http://localhost:8080 —you should see the Tomcat welcome page.

Part C: VS Code & Project Workflow

7. Install & configure VS Code Remote-WSL

  1. Install Visual Studio Code on Windows.
  2. In VS Code → Extensions (Ctrl+Shift+X) → install Remote – WSL.
  3. Click the green >< icon (bottom-left) → Remote-WSL: New Window.
  4. In that WSL-connected window, install:
    • Extension Pack for Java (vscjava.vscode-java-pack)
    • Tomcat for Java (adashen.vscode-tomcat)

8. Copy the PREDIUM project into WSL

  • From Windows Explorer: copy your PREDIUM folder into
    \\wsl$\Ubuntu\home\santiago\projects\PREDIUM
  • Or in WSL:

9. Open the project in VS Code

:::note On first run, you’ll see “Installing VS Code Server for x64…” in your WSL shell. Please wait for it to complete before interacting with the editor—otherwise you may end up editing files on Windows by mistake. :::

10. Register Tomcat in VS Code

  • In the WSL-connected VS Code window → Tomcat Servers view (elephant icon or Cmd/Ctrl+Shift+P → Tomcat: Show Servers View).
  • Click ➕ Add Tomcat Server → select /opt/tomcat9.
  • You should now see Local Tomcat 9.0.85 listed.

11. Build & package the WAR

On success: dist/PREDIUM.war is generated.

12. Deploy & run in VS Code

  • In VS Code’s Explorer, right-click dist/PREDIUM.warRun on Tomcat ServerLocal Tomcat 9.0.85.
  • VS Code will deploy and start your application.

13. Verify & debug

  • Browse to http://localhost:8080/PREDIUM/ to see your live app.
  • To debug: in Tomcat Servers view → right-click the server → Debug → select the same WAR; set breakpoints in VS Code.
Here’s that same “Connect to PostgreSQL on Windows from WSL” doc—but boiled down to copy-and-paste commands only. No manual file-edits, no chasing IPs.

14. Connect PostgreSQL on Windows from WSL (v16, copy & paste)

  1. Configure PostgreSQL on Windows & open the firewall
  2. Fetch the Windows-host IP inside WSL
  3. Install the client & verify the connection
  4. Configure your Spring/Hibernate application
    Replace <YOUR_WINDOWS_IP> with the value you obtained in step 2:

Extra Tips
  • Change HTTP port: edit /opt/tomcat9/conf/server.xml.
  • View logs: VS Code → Output panel → select Tomcat Server.
  • Restart: right-click the server → Restart.