To take an example, Java can be used for a great many things. It's nowhere near as specialized as a tack hammer. So this isn't as easy a decision as you are making out.
Technically, you should learn the most general tools first. Java is not one, it is designed to be explicitly limited.
Both Python and C++ are general albeit Python had a major disadvantage in performance while C++ in clarity. (That said, more modern versions of both have the disadvantages reduced.)