# Customize Micronaut for Upsun Fixed

Now that your code contains all of the configuration to deploy on Upsun Fixed, it's time to make your Micronaut site itself ready to run on an Upsun Fixed environment. There are a number of additional steps that are either required or recommended, depending on how well you want to optimize your site.

## Install the Config Reader

You can get all information about a deployed environment,
including how to connect to services, through [environment variables](https://fixed.docs.upsun.com/development/variables.md).
Your app can [access these variables](https://fixed.docs.upsun.com/development/variables/use-variables.md#access-variables-in-your-app).

Below is an example of how to install the Config Reader for Java using Maven:

```xml

    sh.platform
    config
    2.2.2

```

and Gradle:

```txt
compile group: 'sh.platform', name: 'config', version: '2.2.2'
```

## `.environment`

The `.platform.app.yaml` file on the [previous page](https://fixed.docs.upsun.com/guides/micronaut/deploy/configure.md#configure-apps-in-platformappyaml) has been pulled directly from the [Micronaut template](https://github.com/platformsh-templates/micronaut/blob/master/.platform.app.yaml). It is sufficient to deploy Micronaut on it's own, but since Micronaut makes it possible to overwrite configurations without impacting the application itself, you might elect to rely more heavily on environment variables in it's place.

Consider this simplified `.platform.app.yaml` file:

```yaml  {location=".platform.app.yaml"}
name: myapp

type: "java:11"

disk: 1024

hooks:
  build: mvn clean package

web:
  commands:
    start: java -jar $JAVA_OPTS $CREDENTIAL target/file.jar
```

On Upsun Fixed, we can set the environment variable `JAVA_OPTS` by committing a `.environment` file to the repository's root. Upsun Fixed runs `source .environment` in the application root when a project starts, and when logging into the environment over SSH.
That gives you a place to do extra environment variable setup before the application runs, including modifying the system `$PATH` and other shell level customizations.
It allows us to define `JAVA_OPTS` when running on Upsun Fixed, but otherwise not be used during local development testing.

```shell
# .environment
export JAVA_OPTS="-Xmx$(jq .info.limits.memory /run/config.json)m -XX:+ExitOnOutOfMemoryError"
```

**Tip**: 

To check the Garbage collector settings, please, check the [Java Performance tuning section.](https://fixed.docs.upsun.com/languages/java/tuning.md)


