Made java installation conditional

There may be java installation called from different module
   which can cause duplicate declaration.
Making java installation conditional will avoid duplication.
Merge pull request #5 from hkumarmk/java_optional_installation

Made java installation conditional
fix cassandra2 compatibility