Getting Started with EK9 · Appendix D
Installing and Running EK9
You do not need much to run everything in this book. This appendix covers the essentials. The full tour of the development environment — every panel, every refactoring tool, the AI assistant and the automation — lives in the companion book, The EK9 IDE and Refactoring Toolset.
Installing EK9
These are the steps the EK9 website (ek9.io, in its Downloads section) gives:
- Download the compiler for macOS, Linux or Windows from the EK9 repository linked there.
- Unpack it (zip, tar.gz or dmg) in a directory of your choice, with no spaces in the path.
- Install Java 25 or later, and put Java's
bindirectory on yourPATH. - Put the directory you unpacked EK9 in on your
PATH, and set the environment variableEK9_HOMEto the same directory. - Make a new directory (again, no spaces in the path), put the Hello World program from
Hello, EK9 in a file called
HelloWorld.ek9, and at a command prompt typeek9 HelloWorld.ek9.
If everything is in place you will see Hello, World.
On a Mac with Apple Silicon, the download may be a disk image named like
ek9-<version>-macos-arm64.dmg. That one carries its own Java runtime, so you can skip step 3 and
EK9_HOME: open the image, drag the EK9 folder onto Applications, add
export PATH="/Applications/EK9:$PATH" to the file ~/.zshrc, open a new terminal and type
ek9 -V. The README.txt inside the folder says the same.
The EK9 IDE
Once ek9 is installed, ek9 -ide starts the EK9 IDE (it needs the IDE distribution installed
beside the compiler; if it is missing, ek9 -ide says so). For a beginner it is the smoothest way to
work. It bundles three things you would otherwise install and wire together yourself:
- the editor, which understands EK9 as you type,
- the compiler, so a keystroke builds your program, and
- built-in help, so when the compiler points at a problem you can read what it means and how to fix it right there.
That last part is what makes "the compiler as your guide" work for a true beginner. A bare text
editor and a command line can do the same job, but you have to carry more in your head. The full
tour of the IDE is in the companion book (ek9.io/ide/).
Under the hood: Java 25
EK9 compiles your code to run on a modern Java runtime (Java 25), which is why step 3 above installs it. Both the command line and the IDE use it.
Running from the command line
This book uses the ek9 command, typed in a terminal, from Hello, EK9 on: it compiles a file, runs
it and runs its tests, and the exact commands appear beside the examples in each chapter. Every
example was built and run this way before printing. The same command serves for scripts and, later,
for building and sharing packages. The complete list of command-line options is printed by ek9 -h,
and documented in the IDE companion book.
EK9 also has an interactive REPL, where you can try a line of EK9 and see the result
immediately — handy for experimenting with a value type or an operator. Start it with
ek9 -repl. The IDE companion book covers what it can do.
Getting the examples
Every worked example in this book is available as a single download, examples.zip. Unpack it,
open a chapter's folder in the IDE, and press run. Changing an example and watching what the
compiler says is one of the fastest ways to learn EK9.
In the EK9 reference: Command Line in EK9