Skip to content

JDK Installation ​

Prerequisites ​

The Docker commands below use a Linux server as an example. Before starting, confirm the following:

  1. Docker is installed and running, and the current account has permission to run docker commands.
  2. The backend has been packaged as fastbee-admin.jar and uploaded to /var/data/java/.
  3. Port 8080 is not occupied by another service, and the firewall or security group allows access as required by the deployment.
  4. The upload and log directories have been created:
bash
mkdir -p /var/data/java/uploadPath /var/data/java/logs
test -f /var/data/java/fastbee-admin.jar

Installing in the Operating System ​

Native JDK installation differs between Windows and Linux. This page does not repeat general installation tutorials and instead focuses on Docker. The container uses the openjdk:8-jre image, so no separate JDK installation is required on the host.

Docker Installation and Backend Deployment ​

提示

Before running the container, create a bridge network if one does not already exist for communication between containers: docker network create -d bridge fastbee-bridge

  1. Confirm that the packaged fastbee-admin.jar has been uploaded to /var/data/java/.
  2. Run the following command:
shell
docker run \
--name java \
--publish 8080:8080 \
--volume /var/data/java/fastbee-admin.jar:/server.jar \
--volume /var/data/java/uploadPath:/uploadPath \
--volume /var/data/java/logs:/logs \
--volume /etc/localtime:/etc/localtime \
--env "TZ=Asia/Shanghai" \
--network fastbee-bridge \
--restart unless-stopped \
--detach \
openjdk:8-jre \
java -jar /server.jar
  1. Command parameter descriptions:
shell
--name         # Container name
--publish      # Container port mapping
--volume       # Mounted volume path, persisting container files on the server
--env          # Set container environment variables
--network      # Network mode: container/none/bridge/host
--restart      # Restart policy: no/on-failure/always/unless-stopped
--detach       # Run in the background

Verifying the Deployment ​

  1. Check the container status and port mapping:
bash
docker ps --filter name=java
docker port java 8080
  1. Inspect the startup logs and confirm that the application has started without recurring exceptions:
bash
docker logs -n 200 java
  1. Access the backend or frontend entry point for your deployment architecture, then verify basic functions such as login and the device list. If the container repeatedly exits, preserve and inspect the logs before recreating it.

FAQ ​

What should I do if the container exits immediately after startup? ​

Run docker logs -n 200 java to inspect the exception. Confirm that /var/data/java/fastbee-admin.jar is a valid file rather than a directory, the mount paths match the startup command, and dependencies such as the database and Redis are reachable with the current application configuration.

What should I do if the container is running but port 8080 is unreachable? ​

Run docker port java 8080 to verify the port mapping, check the server firewall and cloud security group, and use the application logs to confirm that the backend is listening on port 8080 inside the container.

What should I do if uploaded files or logs cannot be written? ​

Check that /var/data/java/uploadPath and /var/data/java/logs on the host match the container mount paths, and that the user running the container has write permission. Adjust directory ownership or permissions for the actual account instead of using chmod 777 as a long-term solution.