> For the complete documentation index, see [llms.txt](https://www.andhowconfig.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.andhowconfig.org/user-guide/changing-the-load-order.md).

# Changing the Load Order

## Changing the Loader Order <a href="#h.p_ldwcvoyaib6_" id="h.p_ldwcvoyaib6_"></a>

It's easy to edit or change the order of the loaders:

```java
import org.yarnandtail.andhow.*;
import org.yarnandtail.andhow.load.std.*;

public class ModifyStdLoaderOrder implements AndHowInit {
    @Override
    public AndHowConfiguration getConfiguration() {
        return AndHow.findConfig()
            .setStandardLoaders(StdEnvVarLoader.class, StdJndiLoader.class);
    }
}
```

The example class above implements the AndHowInit interface. At startup, AndHow will discover this class and use it to configure itself. In this case, the standard list of seven loaders has been replaced with just two.

## Adding custom loaders

&#x20;Its also possible to leave the standard list intact and insert loaders between the standard loaders:

```java
@Override
public AndHowConfiguration getConfiguration() {
    PropFileOnClasspathLoader pfl = new PropFileOnClasspathLoader();
    pfl.setFilePath("/my.properties");
    return AndHow.findConfig()
        .insertLoaderBefore(StdJndiLoader.class, pfl);
}
```

Only a single instance of each of the Standard loaders is allowed - these are the loaders with names start with 'Std' and implement the StandardLoader interface, however, it is OK to insert any number of any other loader.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.andhowconfig.org/user-guide/changing-the-load-order.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
