Four kinds of imidazolium ionic liquids (ILs) were employed to catalyze the transesterification reaction of rapeseed oil. The effects of molar ratio of methanol to rapeseed oil, catalyst dosage, reaction temperature, and reaction time, and the deactivation of water on catalytic activity were explored. The results showed that imidazolium ILs with long alkyl chains and sulfonated groups exhibited the best catalytic activities due to their strong Brønsted acidity. The catalytic activity was depend on the class="mathmlsrc">class="formulatext stixSupport mathImg" data-mathURL="/science?_ob=MathURL&_method=retrieve&_eid=1-s2.0-S0016236116310316&_mathId=si1.gif&_user=111111111&_pii=S0016236116310316&_rdoc=1&_issn=00162361&md5=bf34de0c53bd1ab92204f4c268069cc0" title="Click to view the MathML source">class="glyphImg imgLazyJSB">class="mathContainer hidden">class="mathCode">SO3H group in the cation, not the anion HSO4−. Water molecules competed with the anion to bind with the protons of the imidazolium cation. This results in the disruption of the structure of ILs, leading to deactivation; increasing the reaction temperature could alleviate this negative effect of water. The yield of fatty acid methyl ester (FAME) remained constant (∼85%) at 130 °C, when the water content increased from 1 wt% to 5 wt%. The highest yield of FAME for the catalyst 1-butylsulfonate-3-methyl imidazolium hydrogen sulfate ([BSO3HMIM][HSO4]) could reach 100% under optimum conditions.