How To Install jflex on CentOS 7

In this tutorial we learn how to install jflex on CentOS 7. jflex is Fast Scanner Generator

Introduction

In this tutorial we learn how to install jflex on CentOS 7.

What is jflex

JFlex is a lexical analyzer generator (also known as scanner generator) for Java, written in Java. It is also a rewrite of the very useful tool JLex which was developed by Elliot Berk at Princeton University. As Vern Paxson states for his C/C++ tool flex 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.

We can use yum or dnf to install jflex on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install jflex.

Install jflex on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install jflex using yum by running the following command:

sudo yum -y install jflex

Install jflex on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install jflex using dnf by running the following command:

sudo dnf -y install jflex

How To Uninstall jflex on CentOS 7

To uninstall only the jflex package we can use the following command:

sudo dnf remove jflex

References

Summary

In this tutorial we learn how to install jflex on CentOS 7 using yum and dnf.