> For the complete documentation index, see [llms.txt](https://www.socketio4j.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.socketio4j.org/installation/installation-zh/getting-started.md).

# 快速开始

## 版本

* 5.0 - 计划中与实验阶段
* 4.0 - 新 API 与适配器 - **LTS** (4.0.x)
  * **4.0.0** - Maven Central 上当前的 GA / LTS 基线
* 3.0 - 父分支维护
  * 3.0.1 - 稳定版 - 与父分支兼容

{% hint style="info" %}

### 请查看版本策略以了解更多 [版本策略](/installation/installation-zh/version-policy.md)

要在 **4.0.0** 实时站点的依赖片段中显示，请按如下方式设置 GitBook 空间变量 [GitBook 空间变量](/installation/installation-zh/gitbook-space-variables.md).
{% endhint %}

> 新项目或刚接触 socketio4j？请使用最新的 LTS（4.0.x+）。

## Java 支持矩阵

| 版本    | 编译所需的最低 Java 版本 | 运行时所需的最低 Java 版本 | 推荐的 Java 版本  |
| ----- | --------------- | ---------------- | ------------ |
| 3.0.x | 11              | 8                | 17 / 21 / 25 |
| 4.0.x | 11              | 8                | 17 / 21 / 25 |

## 安装

### Java

{% tabs %}
{% tab title="Maven" %}
{% code title="pom.xml" %}

```xml
<dependency>
  <groupId>com.socketio4j</groupId>
  <artifactId>netty-socketio-core</artifactId>
  <version>{$socketio.core.version}</version>
</dependency>
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Groovy DSL" %}
{% code title="build.gradle" %}

```groovy
dependencies {
    implementation "com.socketio4j:netty-socketio-core:${socketioCoreVersion}"
}
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Kotlin DSL" %}
{% code title="build.gradle.kts" %}

```kts
dependencies {
    implementation("com.socketio4j:netty-socketio-quarkus:$socketioCoreVersion")
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Spring

{% tabs %}
{% tab title="Maven" %}
{% code title="pom.xml" %}

```xml
<dependency>
  <groupId>com.socketio4j</groupId>
  <artifactId>netty-socketio-spring</artifactId>
  <version>{$socketio.spring.version}</version>
</dependency>
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Groovy DSL" %}
{% code title="build.gradle" %}

```groovy
dependencies {
    implementation "com.socketio4j:netty-socketio-spring:${socketioSpringVersion}"
}
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Kotlin DSL" %}
{% code title="build.gradle.kts" %}

```kts
dependencies {
    implementation("com.socketio4j:netty-socketio-spring:$socketioSpringVersion")
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Spring Boot

{% tabs %}
{% tab title="Maven" %}
{% code title="pom.xml" %}

```xml
<dependency>
  <groupId>com.socketio4j</groupId>
  <artifactId>netty-socketio-spring-boot-starter</artifactId>
  <version>{$socketio.spring-boot-starter.version}</version>
</dependency>
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Groovy DSL" %}
{% code title="build.gradle" %}

```groovy
dependencies {
    implementation "com.socketio4j:netty-socketio-spring-boot-starter:${socketioSpringBootStarterVersion}"
}
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Kotlin DSL" %}
{% code title="build.gradle.kts" %}

```kts
dependencies {
    implementation("com.socketio4j:netty-socketio-spring-boot-starter:$socketioSpringBootStarterVersion")
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Quarkus

{% tabs %}
{% tab title="Maven" %}
{% code title="pom.xml" %}

```xml
<dependency>
  <groupId>com.socketio4j</groupId>
  <artifactId>netty-socketio-quarkus</artifactId>
  <version>{$socketio.quarkus.version}</version>
</dependency>
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Groovy DSL" %}
{% code title="build.gradle" %}

```groovy
dependencies {
    implementation "com.socketio4j:netty-socketio-quarkus:${socketioQuarkusVersion}"
}
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Kotlin DSL" %}
{% code title="build.gradle.kts" %}

```kts
dependencies {
    implementation("com.socketio4j:netty-socketio-quarkus:$socketioQuarkusVersion")
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Micronaut

{% tabs %}
{% tab title="Maven" %}
{% code title="pom.xml" %}

```xml
<dependency>
  <groupId>com.socketio4j</groupId>
  <artifactId>netty-socketio-micronaut</artifactId>
  <version>{$socketio.micronaut.version}</version>
</dependency>
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Groovy DSL" %}
{% code title="build.gradle" %}

```groovy
dependencies {
    implementation "com.socketio4j:netty-socketio-micronaut:${socketioMicronautVersion}"
}
```

{% endcode %}
{% endtab %}

{% tab title="Gradle - Kotlin DSL" %}
{% code title="build.gradle.kts" %}

```kts
dependencies {
    implementation("com.socketio4j:netty-socketio-micronaut:$socketioMicronautVersion")
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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.socketio4j.org/installation/installation-zh/getting-started.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.
