Game Development 6 min read

Run a Command-Line Dou Dizhu Game on Linux: Full Setup Guide

This step-by-step tutorial explains how to prepare a CentOS environment, install Java and Maven, clone the Ratel source code, build the project, launch the command-line Dou Dizhu client, and play the game with various modes, providing all necessary commands and screenshots.

Open Source Linux
Open Source Linux
Open Source Linux
Run a Command-Line Dou Dizhu Game on Linux: Full Setup Guide

1. Introduction

Ever wondered if you could play the popular Chinese card game Dou Dizhu directly from a Linux command line? This guide shows how to set up and run a CLI version of the game.

2. Deploying the Command-Line Dou Dizhu

2.1 Environment Preparation

Project is Java‑based, requiring Java runtime and Maven.
2.1.1 This experiment uses a CentOS 7.5 machine
[root@qll252 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

2.1.2 Install JDK

1. Install JDK via yum (or from source)
[root@qll252 ~]# yum install java-1.8.0-openjdk* -y

2. Verify installation
[root@qll252 ~]# java -version
openjdk version "1.8.0_262"
...

2.1.3 Install Maven

1. Download Maven binary
[root@qll252 ~]# wget https://mirror.bit.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

2. Extract
[root@qll252 ~]# tar -zxvf apache-maven-3.6.3-bin.tar.gz

3. Move to /usr/local/mvn
[root@qll252 ~]# mv apache-maven-3.6.3 /usr/local/mvn

4. Set environment variables
export MAVEN_HOME=/usr/local/mvn
export PATH=$MAVEN_HOME/bin:$PATH

5. Reload profile
source /etc/profile

6. Verify
[root@qll252 ~]# mvn -v
Apache Maven 3.6.3 ...

2.2 Download Game Source

# git clone https://github.com/ainilili/ratel.git

Note: If git is missing, install it with yum -y install git.

2.3 Build the Ratel Project

# cd ratel/
# mvn install package

After several minutes the build finishes.

2.4 Launch the Client

Game follows standard Dou Dizhu rules, supporting various hand types. You can create a private server or join the public server 39.105.65.8 with the -h option.
# java -jar landlords-client/target/landlords-client-1.2.2.jar -p 8888

2.5 Play the Game

After the client starts, connect to a server, set a nickname (e.g., cnLinuxer), choose a mode (PvP, PvE, or Settings), select difficulty, and begin playing. Follow the on‑screen prompts to bid for the landlord and play cards.

Note: Use “10” as 0 and “XS” for the two jokers.

When the game ends, you can try other display modes. The project repository is https://github.com/ainilili/ratel.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Game DevelopmentmavenLinuxdou dizhu
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.