Run Java on CentOS with JRE

How to Run Java Files on CentOS with the JRE

There is a large amount of useful software for Linux packaged away in jar files, the main reason and benefit being that it allows for platform independence. For example, if you find a java utility that can minify, compress, and concatenate static files like JS and CSS for your website, you can download and use it on your own web server, regardless of the operating system.

But, you can’t run these jar files by default on any given Linux installation. A special interpreter needs to interpret the “bytecode” that they contain, and that is what the Java Runtime Environment (JRE) provides. Most Linux packages can be installed by using either the default repositories or by using the extended ones. (In the case of CentOS, these are the “EPEL” repositories.)

However, Java isn’t one of them. You need to download it from Oracle’s website and consent to a license agreement. In fact, this can be a bit of a problem as shown below.

(more…)