function to check java code.