Code readability improvement

Checking the Ruby platform instead of verify if the java.lang is defined.