# JavaAppResource.withOtelAgentDefaultPath

- Module: [Aspire.Hosting.Java](/reference/api/typescript/aspire.hosting.java.md)
- Defined on: [JavaAppResource](/reference/api/typescript/aspire.hosting.java/javaappresource.md)
- Version: `13.6.0-preview.1.26478.8`
- Kind: `method`

Runs the application with the OpenTelemetry Java agent from the location the build tool writes it to.

## Definition

```typescript
interface JavaAppResource {
  // ... omitted for brevity
  withOtelAgentDefaultPath(): JavaAppResource;
}
```

## Signature

```typescript
withOtelAgentDefaultPath(): JavaAppResource
```

## Returns

[JavaAppResource](/reference/api/typescript/aspire.hosting.java/javaappresource.md) `builder`

## Defined on

- [JavaAppResource](/reference/api/typescript/aspire.hosting.java/javaappresource.md) -- `handle`
