In the early nineties, the Internet became a major tool for professionals and fun for amateurs. But the Web by itself does not work: it needs a program that turns hypertext into a page. Although today Java is not often associated with web development, it was the one that started Java-mania.
It is often used by large companies in finance and BigData. Banks, insurance companies, and retail chains all use Java. For instance, Deutsche Bank, Citigroup, and Goldman Sachs Bank develop their systems with Java. The server part of Amazon, eBay, PayPal, Adobe, and Oracle websites also is written in Java.
In Java, code is complex, with lots of words and signs: a syntax often called verbose. Although it can be difficult for beginners, some developers prefer a more formal syntax.
The language comes with numerous frameworks and libraries (such as Spring, PrimeFaces, and Dropwizard). To handle the web, it has the Apache Tomcat application server, providing an environment for running and executing Java code.
Java is still relevant because it is used in mobile app development, web services, software, Big Data, and business processes.
The number of companies ready to outsource your web projects in Java is not as large as the PHP or JavaScript community, but you can find such a company, and believe me, they will be masters of their craft.