# JavaAppExecutableResource Constructors

- Package: [CommunityToolkit.Aspire.Hosting.Java](/reference/api/csharp/communitytoolkit.aspire.hosting.java.md)
- Type: [JavaAppExecutableResource](/reference/api/csharp/communitytoolkit.aspire.hosting.java/javaappexecutableresource.md)
- Kind: `Constructors`
- Members: `2`

A resource that represents a Java application.

## JavaAppExecutableResource(string, string)

- Name: `Constructor(string, string)`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.Java/JavaAppExecutableResource.cs#L20-L22)

Initializes a new instance of the [JavaAppExecutableResource](/reference/api/csharp/communitytoolkit.aspire.hosting.java/javaappexecutableresource.md) class.

```csharp
public class JavaAppExecutableResource
{
    public JavaAppExecutableResource(
        string name,
        string workingDirectory)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `workingDirectory` (`string`)
  The working directory to use for the command.

## JavaAppExecutableResource(string, string, string)

> **Obsolete:** Use JavaAppExecutableResource(string, string) instead. This constructor will be removed in a future version.

- Name: `Constructor(string, string, string)`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.Java/JavaAppExecutableResource.cs#L32-L34)

Initializes a new instance of the [JavaAppExecutableResource](/reference/api/csharp/communitytoolkit.aspire.hosting.java/javaappexecutableresource.md) class.

```csharp
public class JavaAppExecutableResource
{
    public JavaAppExecutableResource(
        string name,
        string command,
        string workingDirectory)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `command` (`string`)
  The command to execute.
- `workingDirectory` (`string`)
  The working directory to use for the command.
