Dude, you definitely live in a non-business, non-corporate dream world, and you definitely mistake both technologies for something that is only used in websites.
Ever played "Rebuild" on iOS? That game is available in the App Store and it is written in Flash. Same goes for "Robokill" on OS X. Or "Machinarium".
Ever used "Cyberduck"? It's in the OS X App Store, too. And it's entirely written in Java. (CyberDuck actually has an Open Source Java VM integrated into its App bundle.)
Then there is this thing called VMware vCenter that is a bread and butter software for my company... And guess what: It's built entirely on Flash AND Java. It's an extremely strategic tool for VMware by VMware, and I doubt that they will ever re-write it just to do anyone the favor to get rid off Flash and Java.
Have you ever used a commercial VoIP PBX? Guess what most applications for these things are written in. Hint: It's not only an island or an American colloquial expression for coffee, it's actually also a software platform and a programming language.
Have you heard of certain cloud-based file sharing software solutions like SeaFile? Guess what they use... Heck, even Photoshop CS3 for the Mac required Java to be installed (I don't know if that has changed with later versions).
Neither Flash nor Java are going away any time soon. Because despite what most people tend to believe, both are platforms that allow developers to write OS- and hardware-independent software and that alone is reason enough for most coders to use them. And if it weren't for Flash and Java, the Mac would have even less business software than it has today.
If a software company like VMWare or PBX manufacturer like ShoreTel chooses to use Java it's not because it produces the best product, but because it's quick and cheap. There are other cross platform solutions out there. A great one is Qt.
You mentioned VMWare specifically, Alright, Well the vSphere native client STILL uses Microsoft J# which was discontinued many years ago. J# was intended to be Java + MS.Net. So as a Java developer could interface with the .net ecosystem without having to learn new syntax or update their core skill set.
It's not like VMWare ever intended to port the native client to Linux / OSX, so why use J# / Java-anything instead of something Windows-Native like Visual C++ or C# which produces better results? Because they already had the Java developers working for pennies.
Also, now that everything is web based, they can continue to skimp on development costs and hire inexpensive developers to code horrible management tools. Not to mention provide free users the the bare minimum to function hopefully forcing them to upgrade.
The people who do great work and make VMWare what is is today are not those who write the management tools. It's the low level developers who make systems like VMotion or HA work. Anyone can write a UI that wraps API commands, But it's the folks who implement the API and write the linux kernel extensions that deserve the money and consideration.
Most phone systems and security appliances (DVR's, alarm systems, physical access control units) use Java because that's how you did things back in the 90's when Java as a technology was revolutionary. And like so many products today, all they need is a new coat of paint to make them seem fresh and new. versionNumber++. Why bother rewriting the software and making it ACTUALLY new if the old one "works"? It will cost less to deal with the tech support requests like "Why do i need ActiveX / IE 7 / Java v6.78? Help make this work please!" Than it does to rewrite everything modern and proper.
TL;DR; - Java is fast and cheap. Not the best or right way in todays world for new products.