As a desktop application, Java beats Flash hands down, but since we are talking about the Java Plugin here, due to the requirement of being embedded in a web page and comparing against Flash the situation is very different.
Years of neglect by Sun on clientside Java, at some points in its history the plugin has been unbelievably broken (super slow, crashing browsers, hanging computers, etc) that I’d go as far as to blame it solely for java’s widespread tainted image of being slow and bloated. Its been so bad and for so long that most Java developers have given up all hope on java applets, hardly anyone uses the them these days. If Sun had focused on client side Java, they could have easily been where Flash is today (especially considering the head start they had).
The Java API is pretty good and its easy to learn. Penetration isn’t a big issue here as its has plenty of marketshare. Its a little verbose for gui development but its pretty good as a generally purpose language.
The Plugin has been way too unreliable and you have to jump way too many hoops to even get close to an experience that Flash provides. I’ve only seen PulpCore come relatively close to providing a flash like experience and even that was some super ninjastic hackage going on under the hood. The situation with the plugin has improved of late but it’ll take a while for the damage to be undone and by the looks of it Flash will be way ahead by the time it does.
Its not only that the java plugin has been bad but Flash has been really good at clientside user experience, even though it doesn’t provide as much as java it does what it does really well. Secondly the tools and editors for Flash have been excellent, really easy for non programmers (Artists).