Learning a programming language is a very broad statement, because there are many different things that you can do with it.
For example, an experience with building user interfaces will not translate well to building server-side apps which interface with a database.
So:
1. First, decide what you want to do with Java. Mobile apps? Desktop apps with complex user interfaces? Server-side apps? Something else? This will give you a direction on what to actually learn.
2. Then, go through a free, but good tutorial to learn the ropes - the basic syntax.
3. Then, I would suggest doing lots of exercises on HackerRank, Project Euler, or similar. This will help you exercise the syntax that you've learned, learn even more in terms of the language and, most importantly, think like a programmer. Thinking like a programmer means to be able to create abstract concepts in your head and working with those. This is a skill that can be learned and can also be forgotten.
4. The things at #3 might not be very motivating, because they might not apply well to real-life problems. To keep yourself motivated, I would suggest to:
- start some projects that fix every-day issues, eg: deleting duplicate photos on your device, parsing your bank statement (exported to CSV) and generating reports, writing a simple game, and so on. Include projects which match the direction defined at #1. Posting your projects on Github might give you an advantage when you'll be looking for a job.
- contribute to an open source project, eg: Eclipse (in the direction defined at #1)
I strongly suggest to work on an active open-source project. If you do things on your own, without peer review, you might do them wrong. Working in a team will help you a lot. Plus, it looks good in your CV.