Well, I can't say that there is a universal way for everybody to learn Java. Some people prefer online courses and a lot of practice, some - offline studying, book-worming etc. My experience with Java started with the question how to learn java and I found reasons for (there were many "for", actually, started from career possibilities, exciting projects, salary, for sure, java place in the programming languages rate).
I can advise...