> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/x.-appendices/e.-the-executable-jar-format/e.3.-launching-executable-jars.md).

# 附录E.3. 启动可执行Jars

`org.springframework.boot.loader.Launcher`类是个特殊的启动类，用于一个可执行jar的主要入口。它实际上就是你jar文件的`Main-Class`，并用来设置一个合适的`URLClassLoader`，最后调用你的`main()`方法。

这里有３个启动器子类（JarLauncher、WarLauncher和PropertiesLauncher）。它们的作用是从嵌套的jar或war文件目录中（相对于显示的从classpath）加载资源（.class文件等）。在`[Jar|War]Launcher`情况下，嵌套路径是固定的（`lib/*.jar`和war的`lib-provided/*.jar`），所以如果你需要很多其他jars只需添加到那些位置即可。PropertiesLauncher默认查找你应用存档的`lib/`目录，但你可以通过设置环境变量`LOADER_PATH`或application.properties中的`loader.path`来添加其他的位置（一个以逗号分隔的目录、存档或存档内的目录列表）。


---

# 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://jack80342.gitbook.io/spring-boot/x.-appendices/e.-the-executable-jar-format/e.3.-launching-executable-jars.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.
