Install-gcc-gnu-c-c-compiler-linux

If you are getting errors like missing of GNU C / C++ compiler on server. To fix you just need to install with help of Linux package installer like YUM, Apt-get etc.

Installation of GNU C / C++ compiler on CentOS

Use following command

yum install gcc gcc-c++ autoconf automake

Installation of GNU C / C++ compiler on Ubuntu/Debian

Here, you can use apt-get command instead of YUM.

 sudo apt-get install build-essential 

On ubuntu for installing gcc and g++ compilers, you just need to install build-essential package. This will also install GNU make.

build-essential contains a list of packages which are essential for building Ubuntu packages including gcc compiler, make and other required tools.

Install java on ubuntu

In this tutorial we will learn how to install java and setup required java variables on ubuntu.

Java is one of the famous programming languages which allow developers to compile programs once and then run anywhere.

In this tutorials commands are provided to install java on ubuntu 16.04.

Installing java using default packages.

First of all we will update all existing packages on OS to latest version.

apt-get update && apt-get upgrade

Once OS’s packages updated install latest version of Java Runtime Environment (JRE) by executing following command:

apt-get install default-jre

You can install jdk instead of jre which is required to compile java programs. JDK is recommended as it includes jre as well.

apt-get install default-jdk

That’s all java is ready to use.

java -version
javac -version

Now setting up java installation path as JAVA_HOME variable. To find location execute command

update-alternatives --config java

Once you get path set it as JAVA_HOME by adding it to file /etc/environment like

JAVA_HOME="/usr/lib/jvm/java-9-oracle/bin/java"

To activate this variable for current session execute following command

JAVA_HOME="/usr/lib/jvm/java-9-oracle/bin/java"

Verify it is activated by executing command

echo $JAVA_HOME

That’s it.