In my case it is by working on our apps. The office has Android apps so while we could debate if that is pure Java, I think it's close enough.
Practice and applying your skills makes you sharper. In decades I've never used a web site training method. I get the books, read and try it out.
The same way you get good at any skill like dancing or playing a musical instrument. You just do it. Practice makes perfect. Also, read about good programming techniques because malpractice makes malperfect.
And like anything that takes skill you have two choices:
I've heard many people say things like "I'd do anything to be able to play the piano like that" or "I'd do anything to be that thin". The trouble is that by "anything" they mean anything but what they actually have to do which is practice, diet/exercise, etc. Unless you are a savant, developing skill at anything takes effort. As you can see we have put a lot more effort into answering your question than you put into asking it.
There are no shortcuts, no tricks, no secrets.
asking more experienced developers whether they would be willing to do code reviews could also help.
also: when finished coding, run it through a sonar cheking and see if you can solve any code-smells or issues that are detected.
My solution for Java programming issues is simple. Don't use Java! Fine for trivial applications, but a pit for system-level applications! Don't be lazy. Learn C++ instead!
Don't use Java!
That may be good advice (or not) but it doesn't in any way help the OP. That's like reading "how do I change my oil" and replying "you should really rotate your tires".