How long can some take to Master java programming?
No one can answer this. Because the true masters are so deeply engrossed in what they do, they are so blissfully doing the thing that to them it no longer is work, it's play. Those ones would have lost the track of time long before the thought even crossed their mind or may be it never did.
The others who can tell you the time it takes to master would be incorrect, because they are to put a lot more time than that, precisely the amount of time that would make them lose the track so that they qualify in the first category.
So to sum up there's no right answer, and the good thing is you don't even have to worry about it. Start doing it and if you find it so good as to being thoroughly enjoying it, you won't need an answer.
and BTW please do take time out to read what s.o.s points to "Teach yourself programming in 10 years" it's one essay every aspiring programmer should read.