Former Sun boss Scott McNealy sided with Oracle on Thursday in its dispute with Google over Android, testifying in court that companies needed a license to use Sun’s Java programming interfaces.