Memorizing can take you pretty far. Mastering and extending a body of knowledge doesn't have to come from independently postulating a few principles and working things out from there (though that can be very fun and satisfying). Focus first on imitation, memorization, then figure out how to apply it. After you can apply it, figure out how to adapt it in certain circumstances. You might even evolve and extend the knowledge, especially as you integrate other things.
One hack I'd suggest for fulfilling the craving of doing things "from scratch" when you're frustrated at a particular problem is to go back to one you already solved, but pick some class or method or set of methods of Java's library you used and make your own version. New problem! Data structures can be the most common. Used a java.util.Stack object? Write your own Stack class. Instead of `int Integer.parseInt(String);`, write your own. Try a hash map when you're a little more experienced. Pretty much everyone with the hunger writes their own string class eventually (usually in C++). Or try to solve the whole problem again in a language that gives you less, like C. It's good practice for college and tech interviews too. Too boring? Waste of time? Good, you'll appreciate it's there next time so that you don't have to keep reinventing the wheel and can just use it as you go about inventing some new thing made of wheels. The only danger is if your appetite is totally consumed, you'll swing the other way always searching and waiting for the right set of already-built dependencies you just have to glue together, and even then you could just hope for a framework that does that, your tolerance for exerting any programming effort for 'boring' stuff will go away, and everything will be 'boring'. That's not a great state to be in if you have aspirations of building rather than simply using.