Today I installed Solr on my server.
Few things to note:
Solr 6 requires Java 8.
In order to switch to Java 8 from OpenJDK etc. after installing Java8, run the following commands.
alternatives --config java
alternatives --config javac
Select Java 8 from Oracle there.