Java is an object-oriented programming language that was first released by Sun Microsystems in 1995. Back in the 90s all the programming languages were not GUI friendly. The only GUI friendly programming language was Visual Basic. Again, back in the 90s Visual Basic did not have the capability to support full object-oriented feature such as Inheritance.
Java is a portable language that can be executed through multiple platform compatible Java Virtual Machine (JVM). Furthermore, you can write code in Windows Operating System environment then deploy it onto the Linux Operating System environment.
In Mobile space
Java is also the native language used to develop the phone applications for Android Operating System. Android Operating System itself is also running on Java Runtime environment. For example, the Pokémon app that people are playing using Android mobile was developed using Java.
Easier to Maintain
Java is a statically-typed language. This means your code will have to be checked for errors before it can be compiled to become an application. In this way the syntax errors will be easier to identify. Since statically-typed languages such as Java are also more strict with the definitions of data members and member functions, you will have fewer surprises and unexpected errors, which means your codebase will be easier to maintain as it grows in size and complexity.
Java may not be the best language, depending on how you applied your programming language. With all the valid reasons mentioned above Java is going to stay for a decade or two. Oracle acquired Sun Microsystems in 2009. Java then became the primary language to build the Oracle stack, such as Oracle Fusion Middleware. As long as Oracle is doing well then Java will be useful.