The strongest drink available on board navy ships was coffee. It
was dubbed "a cup of Joe" after the secretary. It also refers to
the GIs' favorite drink. During World War II, the US defense
workers were supplied with as much coffee as they wanted. Coffee
was a source of warmth and comfort for troops.
A variation is that "a cup of Joe" is the average drink of the
average man. There was a New York company named Martinson's Coffee
owned by a man named Joe Martinson. The neighborhood of the company
would be saturated by the aroma of roasting coffee, and coffee
became known as "a cup of Joe."