Fix unsupported syntax for java cookbook.