# JavaAppResource

- Kind: `class`
- Package: [Aspire.Hosting.Java](/reference/api/csharp/aspire.hosting.java.md)
- Version: `13.6.0-preview.1.26478.8`
- Namespace: `Aspire.Hosting.Java`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting.Java/JavaAppResource.cs)
- Inherits: `ExecutableResource`
- Implements: `IContainerFilesDestinationResource`, `IResource`, `IResourceWithEndpoints`, `IResourceWithEnvironment`, `IResourceWithServiceDiscovery`, [IJavaAppResource](/reference/api/csharp/aspire.hosting.java/ijavaappresource.md)

Represents a Java application resource in the distributed application model.

## Definition

```csharp
namespace Aspire.Hosting.Java;

public class JavaAppResource
    : Aspire.Hosting.ApplicationModel.ExecutableResource,
      Aspire.Hosting.ApplicationModel.IContainerFilesDestinationResource,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithEndpoints,
      Aspire.Hosting.ApplicationModel.IResourceWithEnvironment,
      Aspire.Hosting.IResourceWithServiceDiscovery,
      Aspire.Hosting.Java.IJavaAppResource
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Java/JavaAppResource`
- Public instance properties are exported as ATS capabilities.

## Remarks

The command is always `java`. When the application is launched through a Maven goal or a Gradle task, the wrapper script replaces that command; see `WithMavenGoal` and `WithGradleTask`.

## Constructors

- [JavaAppResource(string, string)](/reference/api/csharp/aspire.hosting.java/javaappresource/constructors.md#constructor-string-string) -- Represents a Java application resource in the distributed application model.
