I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods.
I only know PHP/mysq/JS, and there is not
Does it really matter which language your books use? I mean, you're not gonna copy-paste those examples. And you'll learn to recognize basic constructs (functions, loops, etc) pretty fast. It's not like learning to read Chinese.
Talking about learning time, there's probably no definite answer to this question. I think the best is to look at examples of code both in java and python and see which seems 'nicer', easier and more familiar to you.
Good luck!