A search for pair production of first and second generation leptoquarks is performed in final states containing either two charged leptons and two jets, or one charged lepton, one neutrino and two jets, using proton-proton collision data at s=8 TeV. The data, corresponding to an integrated luminosity of 19.7 fb-1, were recorded with the CMS detector at the LHC. First-generation scalar leptoquarks with masses less than 1010 (850) GeV are excluded for β=1.0 (0.5), where β is the branching fraction of a leptoquark decaying to a charged lepton and a quark. Similarly, second-generation scalar leptoquarks with masses less than 1080 (760) GeV are excluded for β=1.0 (0.5). Mass limits are also set for vector leptoquark production scenarios with anomalous vector couplings, and for R-parity violating supersymmetric scenarios of top squark pair production resulting in similar final-state signatures. These are the most stringent limits placed on the masses of vector leptoquarks and RPV top squarks to date.