Nonsense. Java is one of very few languages that was designed to handle untrusted code from day 1, and it showed in having far fewer vulnerabilities than Flash.
Unfortunately the JVM was slow to start up, so you had an even worse "grey rectangle effect" than Flash, and applets like all plugins were poorly integrated with the rest of the page. Top that off with Java not being particularly great for writing UI or video in (it's fine, but it's not great) whereas Flash had excellent tools for doing vector animations and you can see why Flash was more popular.
Flash at least implemented a VM with a fairly minimal surface. It can only blame its quality of implementation.
Lolwhat? It's fine. It worked great. (It had some vulnerabilities in its history, but so does every sandbox/hypervisor/what-have-you out there)
It granted access to _code_, not to the environment. Basically, you declared in the manifest that "com.mycompany.blah.*" wants to have full access rights, and SM granted permissions to that _code_. So it was predictably easy to subvert this, because Java code was not typically written in defensive style, sanitizing all the input data.
All the modern sandboxes instead isolate the environment.
I shed tears for the Flash games that were killed off by the demise of Flash. I don't shed any tears for Flash itself.