Condensation of ethyl 4-piperidinecarboxylate (I) with benzoyl chloride in pyridine afforded the corresponding benzamide (II). After reduction of the ester group of (II) with NaBH4, the resulting alcohol (III) was converted to chloride (IV) by means of SOCl2. Elimination of the chlorine atom of (IV) with potassium tert-butoxide produced N-benzoyl-4-methylenepiperidine (V), which was hydrolyzed with KOH to yield 4-methylenepiperidine (VI). Finally, condensation of (VI) with the known epoxide (VII) in refluxing EtOH furnished the title compound.