The biggest problem with Java was that it sucked. Java took too long (and too much RAM) to initialize, was too slow to add features, and had too poor developer tools to become the runtime for the web.
Instead Flash took that spot! Only because Flash eventually also ended up sucking too bad (on mobile) did we get the Javascript revolution.
If Java sucked less and developed at the same pace as Flash did, but was open enough that the browsers could implement their own <applet> runtime replacements (for instance if Java was more important for the web than for the server, Google may have bought Sun instead of Oracle), we would probably live in a very different world today.
Instead Flash took that spot! Only because Flash eventually also ended up sucking too bad (on mobile) did we get the Javascript revolution.
If Java sucked less and developed at the same pace as Flash did, but was open enough that the browsers could implement their own <applet> runtime replacements (for instance if Java was more important for the web than for the server, Google may have bought Sun instead of Oracle), we would probably live in a very different world today.