A Jack-tar is one of hundreds of nicknames for sailors. I found this one in Richard Henry Dana’s wonderfully descriptive sea diary Two Years Before the Mast. Dana was Harvard student who left his studies to spend two years (1834-36) enlisted as a sailor. As a result, we have one of the most informative, well-written accounts of ninetenth-century sailing.
Sailors, according to Wikipedia, were often called Jacks. They commonly used tar to waterproof their ships, as well their clothes. Supposedly, tar in the hair would prevent it from getting caught in the riggings.