In this paper, the Cauchy problem of classical Hamiltonian PDEs is recast into a Liouville's equation with measure-valued solutions. Then a uniqueness property for the latter equation is proved under some natural assumptions. Our result extends the method of characteristics to Hamiltonian systems with infinite degrees of freedom and it applies to a large variety of Hamiltonian PDEs (Hartree, Klein-Gordon, Schrödinger, Wave, Yukawa . . . ). The main arguments in the proof are a projective point of view and a probabilistic representation of measure-valued solutions to continuity equations in finite dimension.