Let's start with a definition from Wikipedia: "Java is a general-purpose programming language that is class-based and object-oriented, and designed to have as few implementation dependencies as possible. It is intended to let application developers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need of recompilation.".
Java is one of the most widely used programming languages. A decisive advantage is its platform independence: After installation of a Java runtime environment Java-based applications can run on different operating systems (Linux, macOS, Solaris, Windows, etc.). For comparison: Applications developed on .NET require a Windows platform. The language is also considered simple in comparison to other object-oriented programming languages (such as C++, C#).
Java is mainly in competition with the .NET platform of Microsoft.