The US Navy used to serve alcoholic beverages on board ships. However when Admiral Josephus "Joe" Daniels became Chief of Naval Operations, he outlawed alcohol on board ships, except for very special occasions. Coffee then became the drink of choice, hence the term "Cup of Joe".