Why should you avoid investing much time learning Java ?
Java need to be compiled, which makes Java much less convenient than languages like Python. So, if you're a novice learning to code for the first time, Java is not a good language to start with.
Java is not the fastest. No, it's not pretty. No, it's not as much fun as some languages. But for most vertical apps, it's the best tool for the job.
Python is one of the most chosen programming languages to learn first for its wide use and simplicity. It is a great stepping stone to learning more complex programming languages and frameworks!
If you want to work in building mobile applications, it is better to focus on learning kotlin after learning java basics because most of the android jobs require either kotlin or react. This wasn't the case 2 years ago.