How To Install jflex on Ubuntu 20.04
Introduction
In this tutorial we learn how to install jflex on Ubuntu 20.04.
What is jflex
jflex is:
It is also a rewrite of the very useful tool JLex which was developed by Elliot Berk at Princeton University. As Vern Paxon states for his C/C++ tool flex : They do not share any code though.
JFlex is designed to work together with the LALR parser generator CUP by Scott Hudson, and the Java modification of Berkeley Yacc BYacc/J by Bob Jamison. It can also be used together with other parser generators like ANTLR or as a standalone tool.
There are three methods to install jflex on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install jflex Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install jflex using apt-get by running the following command:
sudo apt-get -y install jflex
Install jflex Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install jflex using apt by running the following command:
sudo apt -y install jflex
Install jflex Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install jflex using aptitude by running the following command:
sudo aptitude -y install jflex
How To Uninstall jflex on Ubuntu 20.04
To uninstall only the jflex package we can use the following command:
sudo apt-get remove jflex
Uninstall jflex And Its Dependencies
To uninstall jflex and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove jflex
Remove jflex Configurations and Data
To remove jflex configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge jflex
Remove jflex configuration, data, and all of its dependencies
We can use the following command to remove jflex configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge jflex
References
Summary
In this tutorial we learn how to install jflex package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.