Java home can't be set after upgrade to xcode 13

I have an issue since we upgrade the yml file to xcode 13.
The builds start to fail on a job where I set java home with this error
and this is the jobs that I try to run:

Did anyone has an idea what I am missing?
The builds work fine with the previous xcode version 12.3.0

It looks like Ruby is not being set correctly. Try replacing your Ruby command with the following: