This issue is mainly with Java version or Maven version.
You can add Java version in the Manage Jenkins -> Tool configuration section as:
JDK -> JDK installations

Then you can choose the required java in the job as follows:

To change Maven:
1. First download maven from: https://maven.apache.org/download.cgi
2. Unzip it in a directory accessible by Jenkins suppose: /home/jenkins/apache-maven-3.2.3
3. Then add maven as

You can also add mvn to PATH and manually execute mvn clean for that project.