+```
+:::
+
+#### Local Applications
+
Without an app name, `cds debug` starts `cds watch --debug` locally:
@@ -575,13 +610,67 @@ Opening Chrome DevTools at devtools://devtools/bundled/inspector.html?ws=...
[cds] - ...
-::: tip Scale to one application instance only
-We recommend to only scale to _one_ app instance on SAP BTP Cloud Foundry, as then your request is guaranteed to hit this one instance.
-If you scale out to more instances, only some of your requests will hit the instance that the debugger is connected to. This can result in 'missed breakpoints'.
-However, it's possible to [route a request to a specific instance](https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html#surgical-routing), which is useful if you can't reduce the number of app instances.
+### Java Applications
+
+#### Remote Applications
+
+To debug remote Java applications in the currently targeted CF space, run:
+
+
+$ cds debug <app-name>
+...
+Debugging has been started.
+Address : 8000
+
+Opening SSH tunnel on 8000:127.0.0.1:8000
+
+> Keep this terminal open while debugging.
+
+
+This opens an [SSH tunnel](https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html) and puts the application in debug mode.
+
+::: details Under the hoods, these commands are executed:
+```sh
+cf ssh -c "~/app/META-INF/.sap_java_buildpack/sap_machine_jre/bin/jcmd `pidof java` VM.start_java_debugging"
+cf ssh -N -L 8000:localhost:8000
+```
+:::
+
+Afterwards, connect a debugger in your IDE at the given port. In VS Code, for example, add a launch configuration like this one:
+
+::: code-group
+```json [.vscode/launch.json]
+{
+ "type": "java",
+ "name": "Attach to Remote Java App",
+ "request": "attach",
+ "hostName": "localhost",
+ "port": "8000"
+}
+```
:::
+Make sure the port matches to what the debug tunnel uses (see the message in the terminal). The default port is `8000`.
+
+> [!NOTE] SapMachine is required
+> SapMachine is required as Java runtime environment for this feature to work.
+> There is nothing to do if you set up your MTA deployment descriptors with [`cds mta`](../guides/deployment/to-cf#add-mta-yaml) or CAP project wizards.
+> See the [documentation of SapMachine](https://help.sap.com/docs/btp/sap-business-technology-platform/sapmachine) for how to configure this manually.
+
+#### Local Applications
+
+Without an app name, `cds debug` starts Maven with debug arguments locally:
+
+
+$ cds debug
+Starting 'mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"'
+...
+Listening for transport dt_socket at address: 8000
+...
+
+
+Then attach your IDE as explained before.
## Debugging with `cds watch`