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 much AI stuff examples in PHP.
There are some books on AI on internet but they use Java , Python.
Now I have to apply AI techniques on web application.
Which language should i choose java or python.
I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php
I have also seen that python can also be used with php as well
So which way should I go and roughly how much it will take me to learn java
I have done java basics but that was 6 years ago
Which language should i choose java or python.

Here are a few things to consider:

java is more widely used (presumably more mature code "out there" to look at - but I haven't tested that out)
python is more prolific (you write faster in python than in java), and from learning the language to writing the code that you want takes less in python than in java
python is multi-paradigm, java is (almost) strictly OOP
java is compiled (whereas python is scripted); this means that java finds your errors at compilation; python at execution - this can make a big difference, depending on your development style/practices
java is more strictly defined and much more verbose than python. Where in java you have to formalize your contracts, in python you use duck-typing.

In the end, the best you could do is set up a small project, write it in both languages and see what you end up preferring. You may also find some restrictions that you can't get around for one of the languages.
In the end it's up to you :)
Edit: that was not an exhaustive list and I tried to be as impartial as I could (but that ends here: I'd go with python :D)
Which language should I use for Artificial intelligence on web projects