America Online Inc. said closely held Software.net will pay $21 million to sell software on AOL, as the No. 1 online service seeks to boost its revenue from electronic commerce. AOL will also take a minority investment of as much as $2 million in the San Jose company. Dulles, Va.-based AOL will share revenue from the software sales if financial targets are met. The company declined to give details. Software.net lets customers download software over the Internet and also sells packaged programs.