> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shardcloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Java Hosting Guide

> Learn how to deploy Java applications on ShardCloud platform.

# Getting Started with Java Hosting

Deploy your Java applications on ShardCloud with minimal configuration and maximum performance.

<Info>
  ShardCloud supports Java applications with automatic JAR execution and dependency management.
</Info>

## Prerequisites

Before uploading your Java application, ensure you have the following project structure ready.

<CardGroup cols={2}>
  <Card title="Required Files" icon="circle">
    Essential files for deployment
  </Card>

  <Card title="Simple Structure" icon="check">
    Clean deployment process
  </Card>
</CardGroup>

## Required Files

Your Java application must include these two essential files:

### 1. Entry Point File

* **File**: `yourapp.jar`
* **Purpose**: Compiled Java application JAR file
* **Requirements**: Must be a valid executable JAR with main class defined

### 2. Manifest Configuration

* **File**: `MANIFEST.MF`
* **Purpose**: Defines JAR metadata and dependencies
* **Requirements**: Valid manifest format with Main-Class and dependency information

### 3. ShardCloud Configuration

* **File**: `.shardcloud`
* **Purpose**: Platform-specific deployment settings
* **Requirements**: Plain text configuration file in root directory

<Warning>
  .sharcloudd and the entrypoint file are required.
</Warning>

## ShardCloud Configuration

The [.shardcloud](/config) file configures your application deployment settings.

### Configuration Example

```bash theme={null}
DISPLAY_NAME=myfirstjavaproject
DESCRIPTION=a simple java application
MAIN=myapp.jar
MEMORY=1024
VERSION=LATEST
```

<Note>
  Java applications typically require more memory than interpreted languages. Choose appropriate memory allocation for your application's needs.
</Note>

## Deployment Process

<Steps>
  <Step title="Build JAR File">
    Compile your Java application into an executable JAR
  </Step>

  <Step title="Configure Manifest">
    Ensure MANIFEST.MF contains correct Main-Class and dependencies
  </Step>

  <Step title="Prepare Configuration">
    Create .shardcloud file with deployment settings
  </Step>

  <Step title="Create Archive">
    Zip or RAR your project
  </Step>

  <Step title="Upload via Dashboard">
    Use [ShardCloud dashboard](https://shardcloud.app/dash) to upload your archive
  </Step>

  <Step title="Deploy & Monitor">
    Application automatically deploys and runs your JAR
  </Step>
</Steps>

## Common Configuration Examples

### Spring Boot Application

```bash theme={null}
DISPLAY_NAME=spring-api
DESCRIPTION=REST API with Spring Boot
MAIN=spring-app.jar
MEMORY=1536
VERSION=LATEST
SUBDOMAIN=springapi
```
