The Josephson current through a long quantum wire