Python is used in Machine learning than Java because of its powerful and easy implementation, and number of inbuilt libraries Pytorch, TensorFlow for deep learning, scikit-learn for data analysis and machine learning), matplotlib, seaborn, scikit (data visualization), etc.
If you want to learn Machine Learning using Python, you can enroll in this Machine Learning Course by Intellipat.
If you are comfortable with java, you can go with Java too. You can watch this video on Machine Learning with Java to get started: