This site does not use cookies. However, the advertisements from Google do use cookies - your continued use of this site will indicate consent to this. For further information on Google's use of cookies, see Google's information page.

Mah-Jong for Linux, Unix, MacOS and Windows

News About Requirements Subscribe Getting Using


2019-06-07: Version 1.15 fixes a couple of minor bugs, and adds a display option to disable rotated text. This release is not currently available for 32-bit Linux, or Windows, as I do not at present have build environments for them.

2014-01-06: Version 1.14 fixes still remaining bugs in saving and resumption, and adds a few small convenience features to xmj.

2013-08-29: Version 1.13 fixes a major bug in a feature that presumably nobody uses, namely saving and resuming of games. It also fixes a very minor bug in the graphical client.

2012-05-04: Version 1.12.1 fixes a minor problem with the distributed Makefile, which had crept in at some point. As this affects only those building from source, binary releases have not been made.

2012-02-03: Version 1.12 fixes a couple of minor infelicities in the interface (in particular, the robot options in the new game dialog are now saved between sessions). The Linux binaries now include a version for 64-bit x86 architecture. The code should now be 64-bit clean.

2011-08-29: Version 1.11 fixes a couple of minor bugs, and a long-standing minor missing feature. The latter is that it is now possible to convert a pung to a kong immediately after you claim it, if you accidentally said "Pung!" instead of "Kong!". Note that xmj now needs version 2.14 or later of GTK+2. If this is a problem for somebody, let me know.

2009-07-10: Version 1.10 converts xmj to use the current GTK+2 toolkit instead of the very old and unsupported GTK+1 toolkit. It also adds a few new features (mostly at the UI level), and fixes a surprising number of rather long-standing bugs. I recommend all users to upgrade. The Windows version is not as pretty as the new Linux version, but now all the features (such as accelerator keys) work in Windows as well as in Linux. (Note that a GTK1 version is still available for Windows, in case you want to run it on an old Windows system where GTK+2 doesn't work.) See the CHANGES for a summary of changes.

This is the end of the line for xmj version 1. There will be no further releases except bug fixes. It's possible that a much improved version 2 will appear one day, but this could be anywhere from a year to a decade away, or never!

What is it?

This is a set of three open-source (GPL) programs which provide a networked Mah Jong program, together with a computer player. Thus the game can be played by four humans, by a human and three computer players, or any other combination. There is a server program, which handles the game - only one game, since I'm not trying to compete with Yahoo! and friends -, an X client to allow humans to play naturally, and a computer player. The version of Mah Jong is that generally called Chinese Classical. Of course, there are many variants within this; I intend to accommodate most of the more interesting variants via options, but this is future work. In the longer term, I might also be interested in adding Hong Kong and Japanese versions. I'm not interested in adding American versions, though somebody else might be.

Books on Mah-Jong

The best book for use with this program is A. D. Millington's Complete Book of Mah-Jong; this is now considered the standard reference for the classical Chinese game, and my program uses Millington's rules. It's now out of print, but second-hand copies are available from Amazon UK.

Web resources

The single most important Web resource for mah-jong is Tom Sloper's Mah Jong FAQ site. Check there before anywhere else, for almost any question.

A recent UK-based site which contains a short (but accurate) summary of several aspects of mah-jong is at I'm not sure what the plans for the site are, but it looks worth keeping an eye on.


There's a bunch of screenshots in the directory screenshots. Each is a gif of about 40kB.

System requirements

The programs should compile and run on any reasonably modern Unix system. (This is known to include GNU/Linux, Solaris and Irix.) They also work on 32-bit Windows systems.

For version 1.11, your GTK+2 must be at least 2.14.

For version 1.10 (Linux), you need GTK+2, preferably in a fairly modern version. This should be installed on any Linux distribution less than about eight years old. For the Windows GTK2 build, the required libraries are included in the zip file; but you need Windows 2000 or later. If you are running an older version of Windows, you should probably use the GTK1 build, in which case you will need to install the file as well.

To build the programs from source, you also need Perl, and preferably GNU make. On Windows you will need various Microsoft files which are part of the Platform SDK (which is fortunately available free of charge from their Web site); and though it is theoretically possible to build in an MS development environment, for all practical purposes you will need MinGW.

To decide whether you want to upgrade, read the brief notes of the differences between successive releases in the CHANGES file.

Subscribe to release information

I no longer maintain the Freshmeat record for this project. If you wish to receive notifications of new releases, and perhaps occasional similar announcements or requests for information, please subscribe using this form. Naturally, your email address will be used for this purpose only.

Email address:

Please type the characters "ken3ding4" (without the quotes) in this box:
(just to stop dumb automatic subscriptions).

Source code

Source code (current and old versions, and patches where appropriate), in the form of gzipped tar file, can be found in the Source directory.

Linux binaries

The mj-linux-i386 binary distribution was compiled under GNU glibc-2.2.5 (aka libc-6), XFree86-4, GTK+ 2.6. It should run on practically any Linux i386 system.

The mj-linux-x86_64 binary distribution was compiled under a Linux 2.6 kernel, GNU utilities and libraries, GNU glibc-2.12 (libc-6), Xorg-7.4, GTK+ 2.6.

The normal Linux binaries are in the Linux directory.

For Debian users: xmj is part of Debian, as a package called mah-jong.

For Fedora: it's in the package mj.

For FreeBSD, it's games/mahjong.

Windows executables

The mj-win32-i386-gtk[12] distributions were compiled under Windows 2000, with fairly recent MinGW, and GTK+ for Win32 version 1.3 release of 2004-03-15 for -gtk1, and a recent GTK+2 release for -gtk2. The -gtk1 binaries should in theory run on any Win32 system (except old systems lacking MSVCRT.DLL); the -gtk2 binaries need Windows 2000 or later, because GTK+2 does.

The binaries are in the Windows directory.
For the -gtk2 distribution, the necessary DLLs are included in the zip file (which is why it's so large).
For the -gtk1 distribution, you need (if you have not downloaded them before) the libraries in the (1.8MB) file which you will also find in the Windows directory. The contents of this file should be unpacked into the folder of the mj program.

Using the programs

The user documentation comes in two parts (also available combined into a man page): use.txt is the basic documentation, and rules.txt describes the rules of the game as implemented.

Making a donation

Do you enjoy using this program? Would you like to help me improve my Mah-Jong book collection, buy me a virtual drink, or whatever?

You can make a donation via PayPal. The amount is up to you; if you want a suggested figure, how about fifteen euros/dollars?

Julian Bradfield
Last modified: Fri Jun 7 18:04:14 BST 2019