A lawsuit that sought to keep Robert F. Kennedy Jr.’s name from appearing as an independent candidate on the New Jersey ballot in his run for president was dismissed Monday by the Mercer County Superior Court as the incorrect venue for such a challenge.

The lawsuit, Salmon v. Kennedy, was filed by a pro se plaintiff, Scott D. Salmon, an election lawyer and partner at Jardim Meisner Salmon Sprague & Susser in Florham Park. The complaint, filed in June in Mercer County, claimed that Kennedy is not eligible to appear on the New Jersey ballot under what’s known as the state’s “sore loser” statute because Kennedy ran for the Democratic nomination for about 10 months.