Most of the online dictionaries give this kind of alternate meaning of jug:
Slang. jail; prison.
When I was in grammar school it's what we called detention: "If you talk back to the teacher, she's going to send you to the Jug."
Collins says the origin of the main meaning as a narrow-necked container is
[C16: probably from Jug, nickname from girl's name Joan]
and Etymonline goes on to say the origin (of the name of the receptacle) is unknown:
Perhaps it is from jug "a low woman, a maidservant" (mid-16c.), a familiar alteration of Jug, a common personal name such as Joan or Judith.
Not sure what to do with that information.
The OED's first instance of jug meaning a prison occurs under "Stone-Jug" where, in 1796, in Grose's Dictionary Vulgar T, "Stone-Jug" refers to "Newgate, or any other prison." Under "jug" itself, the OED cites an 1861 poem in which the narrator was sentenced to "ten years in the Jug." (There is an earlier reference, from 1834, but the example given feels more tangential to me.)
Now, the relation between a prison and a container of any kind must be fairly obvious. But if the earliest reference to this relationship is itself in a dictionary, the term must have been in use in that capacity well before that. I'm curious to know whether there is any more substantial evidence of an actual usage underscoring that relationship. I'm also curious to know how the usage survived and was transported from 18th century Newgate prison to the detention room of an American parochial grammar school in the 20th century, especially since I don't recall ever hearing "the Jug" as a reference to any American prison.
Best Answer
'Jug' as 'jail' in the U.S.
The earliest mention of jug in the sense "jail or prison" in a U.S. slang dictionary appears in John Bartlett, Dictionary of Americanisms, fourth edition (1877):
John Farmer, Americanisms New and Old (1889) has this entry:
That U.S. English speakers were using jug to mean jail from a fairly early date is suggested by this item in the Rising Sun [Indiana] Times (January 3, 1835):
And from an untitled item in the Indiana American (June 1, 1838), reprinted from the Louisville [Kentucky] Enquirer:
J.E. Lighter, The Random House Historical Dictionary of American Slang (1997) points to an instance of jug in the sense of "jail or prison" from 1815–1816, which Craigie & Hulbert, A Dictionary of American English on Historical Principles (1936–1944) had cited more than 75 years ago:
Lighter's first example evidently originated in the Providence [Rhode Island] Patriot (January 7, 1815), reprinted in Supplement to Niles' Register—Scraps (1815–1816):
'Jug' as a pillory in Scotland
An interesting example of "jug" as the name of a Scottish punishment appears in Frances Brown, "The Virginian: A Legend of Old Glasgow," in The Mirror of Literature, Amusement, and Instruction (March 1847):
In this story, "Virginian" refers to a resident of Virginia Street in Glasgow; the story is set in 1746.
Chambers Scots Dictionary (1911) has these entries for jougs and juggs:
A note explains the dagger before jougs as follows:
Chambers seems to be making a distinction between jougs and juggs: although both involving restraints fastened about the neck of a person to be punished, the former is equated to a pillory and the latter to a chained collar. Neither seems especially close in meaning to a jail or prison.
John Jamieson, An Etymological Dictionary of the Scottish Language (1808), however, indicates that the two words refer to essentially the same thing:
The term jougs (or jogges) goes back a long way in Scotland. A correspondent to Notes and Queries (September 29, 1855) the meaning of joggis in the following quotation found in "Glenn's History of Dumbarton":
In response, the editor provided the following excerpt from "Maxwell's Burden of Issachar":
Robert Brown, The History of Paisley, from the Roman Period Down to 1884 (1886) follows Jamieson in deriving the word from the Latin jugum ("yoke") and provides a sketch of the restraining device.
Also noteworthy is this somewhat ambiguous instance of jug in "Jack Whiskey: A Song," in The Anti-Jacobin Review; True Churchman's Magazine; and Protestant Advocate (March 1817):
There seems to be a double entendre in the lyrics, as "Jack Whiskey" appears to be a historical person whom readers would recognize and, at another level, the personification of hard liquor. But while "whiskey's in the jug" can certainly be read literally, the fat that "Jack Whiskey" is said to be in a Derry jail suggests that jug might also be read as "jail or prison" here.
'Stone jug' as 'jail or prison' in England and the U.S.
Stone jug first appears in an English slang dictionary in Francis Grose, A Classical Dictionary of the Vulgar Tongue (1796):
The same authority also lists stone doublet as a slang term for a prison. No such entry appears, however, in the 1785 or 1788 editions of Grose's Classical Dictionary. Both of these volumes identify only stone doublet as stone-based metaphor for prison.
Stone jug also appears as a variant name for Newgate prison in Frances Grose & Pierce Egan, A Classical Dictionary of the Vulgar Tongue, revised edition (1823), although by that point stone pitcher seems to have become a somewhat more common alternative:
This new entry for pitcher is not Egan's invention, however. He seems to have lifted it verbatim from Memoirs of James Hardy Vaux, Written by Himself (1819).
An early instance of stone jug in a U.S.-published book appears in a translation of Frederick Schiller, The Robbers, printed in Select Plays, from Celebrated Authors; Performed at the Principal Theatres in the United States of America (Baltimore, 1802):
The translator of this version of Schiller's play was Benjamin Thompson, an Englishman; nevertheless, the example does show that American audiences were exposed to the term stone jug from an early date.
Other instances of "stone jug" from before 1826 appear in British publicans and at least two other U.S. publications. From Thomas Dutton, The Captive Muse; A Collection of Fugitive Poems (London, 1814):
The author of this book was a prisoner of war in France and writes about his confinement there.
From Thomas Brown, London, or, A Month at Steven's (London, 1819):
From "Memoirs of Mr. Hardy Vaux," in The London Magazine (January 1820):
From anonymous, Memoirs of a Man of Fashion, Written by Himself (London, 1821):
From J.K. Paulding, Koningsmarke, the Long Finne (New York, 1823):
From John Thurtell, "A History of the Gaming House, and Gamesters of the Metropolis" (London, 1824):
From Robert Coffin, The Life of the Boston Bard, Written by Himself (Mount Pleasant, New York, 1825):
Conclusions
The earliest example that I could find of the jug as "jail or prison" is from a Rhode Island newspaper at the beginning of 1815. Instances of "the stone jug" in the same sense arise in England by 1796, and become fairly frequent by the 1820 in England—but also at last occasionally in the United States as well. The similarity in age of the two expressions is noteworthy and, I suspect, not coincidental.
Much earlier instances of jougs, juggs, jogges, joggis, etc., occur in records from Scotland—but there the meaning is not "jail or prison" but "pillory or iron collar." The U.S. term may owe its existence to the Scottish term, but I am not at all sure that it didn't arise independently.
The key question whether the English stone jug—one of an array of late eighteenth-century and early nineteenth-century names for prison that also includes stone doublet, stone tavern, and stone pitcher—owes anything to the existence in Scotland from a much earlier date of "the jug"—a pillory. Although the connection isn't especially far-fetched, I tend to think that it is illusory.
If I had to commit to a theory—and I don't—I would favor the idea that "the stone jug" appeared as slang metaphor for prison in England in the late 1700s and that it was sometimes shortened to "the jug"—especially in the United States—within two or three decades.