# JavaAppResource

- Kind: `class`
- Package: [Aspire.Hosting.Java](/reference/api/csharp/aspire.hosting.java.md)
- Version: `17.0.0-preview.1.26567.5`
- Namespace: `Aspire.Hosting.Java`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/2d325b13709752ba6d9a943635c5e2940a2530c0/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.

## Properties

- [ResourceTypeDisplayName](/reference/api/csharp/aspire.hosting.java/javaappresource/properties.md#resourcetypedisplayname) : `string` `get` -- Gets the default human-readable name of this resource's type.
