Juniper based spirits have been used for medicinal purposes since the early middle ages. Recipes similar to that of Gin can be traced back to the late 1400s. The Dutch were the first to drink juniper-based spirits recreationally in any great volume, producing a drink called Genever, the pre-cursor to gin.
We can thank the first Earl of Leicester Robert Dudley (and a Warwickshire resident, based at Kenilworth Castle) who indirectly brought Gin to England. Dudley was a strong supporter of the protestant cause, so much so that when the Dutch rebelled against the Spanish Habsburg rule in 1585, he led the English campaign to the Netherlands. While Dudley failed in his military role, he sent his men home with a taste for Genever.
At this time English distillers were starting to dabble with Juniper as flavouring for spirits and were selling it in ‘Strong Water’ shops; by 1600 there were 200 of these in London alone.
We can’t be sure that Shakespeare drank this juniper flavoured ‘Strong Water’ however we know that Shakespeare did enjoy a tipple and at this time he spent much of his time in London, so the opportunity was certainly there.