J/ψ production measurement at midrapidity from pp to Pb-Pb collisions with ALICE