Note that today things are quite different, and Apple can do what Sun wanted to do, but do it well. Market conditions are very different, and Apple, of course is the 800lb gorilla that Sun couldn't quite get to be. It's kinda funny: Apple and Sun weren't all that different, and Sun then and Apple now even more so. Apple just wasn't into servers, and Sun just wasn't into consumer hardware, but both wanted to vertically integrate hardware and software. Apple has a walled garden, Sun didn't. I do think these differences are relevant to why Sun failed, but the leadership differences count for a lot too: no one would compare Steve Jobs to Jonathan Schwartz, nor even to Scott McNealy -- it's just night and day. Now the differences in what Sun and Apple sought to do also evince differences in leadership.
They, and the software that ran on it (Dataviews), and their customers (Westinghouse Software in my case) were all soon undone by the arrival of powerful commodity Wintel.