Java is not really hated no?
Anyway Java is a lot older than most other languages used frequently today. This means that theres a lot of software still build in Java around especially in Companys that are going for a longer time. So if you wanna learn Java it's not bad especially if you wanna get a job in one of these Companys.
It can also be used for Mobile Apps specifically for Android, tho the trend is to use Kotlin cause it is more centered around Android Development and anyway also has a lot in comon with Java working on the JVM and using the JDK. It's a simpler Language than Java tho so maybe a better start for beginners.
Other Mobile App languages commonly used is Swift for IOS Development and Flutter for Cross platform or you use React Native with Javascript, also Cross Platform.