ecj command not found

In this troubleshooting guide we learn how to fix ecj command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

ecj: command not found

or when using sudo you get the following error message

sudo: ecj: command not found

Solutions to ecj: command not found

How To Fix ecj: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu ecj is provided by ecj package.

ecj is:

This package provides a standalone version of the Eclipse JDT compiler which is distributed as part of Eclipse. It passes the JCK (Java Compatibility Kit) and is compatible with Java 1.3, 1.4, 5, 6, 7, 8 and 9.

To fix this problem, we can install more using the command below.

sudo apt-get -y install ecj

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ecj.

sudo apt -y install ecj

Or if you have aptitude installed you can use the following command.

sudo aptitude install ecj

Summary

In this tutorial we learn how to fix ecj command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.