There's a few ideas about the origin of this popular phrase for coffee. One has to do with the man shown above, Josephus Daniels, who was Secretary of the Navy. On the month of June, 1914, he banned all U.S. Navy ships from serving alcoholic beverages. The sailors weren't too thrilled with the decision, because they had to resort to the next strongest drink on the list, which was coffee!
Since Josephus Daniels was the one responsible for banning alcohol and "forced" everyone to make the switch to coffee, the sailors nicknamed the drink after him, thus it became "a cup of joe," Joe being short for Josephus. That's the theory anyways.
Another theory has to do with the soldier but doesn't involve Secretary of State Daniels.
In case you don't know, or haven't figured it out by now, a cup of joe is the nickname for a cup of coffee.