Sun's revenue came from workstations, which got disrupted by PCs. Everything else drove that.
Sun failed because of poor execution. They blew the cloud computing opportunity. Their sales people did not chase orders like the HP guys did (this is for a personal experience ). Their Java application server sucked when compared to Websphere and Weblogic. They could not deliver a good story with MySQL acquisition. They let Linux get ahead of Solaris , at least in mind share.