Files
2026-02-08 23:58:00 +08:00

39 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# LocalChatApp 启动指南
**注意**:以下命令均假设您的命令行当前所在目录为项目根目录:
`d:\Code\doing_exercises\programs\LocalChatApp`
## 1. 编译项目 (如果代码有更新)
如果这是第一次运行或代码有过修改,请先执行编译:
```cmd
mvn clean compile
```
## 2. 启动服务端
在终端中执行以下命令:
```cmd
java -cp "target\classes;lib\*" server.Server
```
**关闭服务端的方法**
在服务端运行的终端窗口中输入 `exit` 然后按回车键,服务器将会保存数据并安全退出。
> 注意:直接关闭窗口可能会导致部分数据丢失。
## 3. 启动客户端
请打开一个新的终端窗口(可打开多个以模拟多用户),执行以下命令:
```cmd
java -cp "target\classes;lib\*" client.Client
```
## 4. 运行打包后的程序
本项目支持通过 `jpackage` 和 Inno Setup 打包生成的独立可执行文件。
### 客户端 (独立可执行文件)
位于 `dist\LocalChatClient\LocalChatClient.exe`
双击即可运行,无需预先安装 JRE,因为已内置运行时环境。
### 安装包
位于 `dist\Output\LocalChatApp_Setup.exe`
运行该安装程序可以将客户端安装到系统中,并创建桌面快捷方式。