You should learn Python first and then think about learning Java, as the automation-related market prefers Python over Java.