  We consider a general approach to the theory of continuous media starting
from Lagrangian formalism. This formalism which uses the trajectories if
constituents of media is very convenient for taking into account different
types of interaction between particles typical for different media. Building
the Hamiltonian formalism we discuss some issues which is not very well known,
such as relation of famous Thompson theorem with the symmetry with respect to
volume preserving diffeomorphisms. We also discuss the relation between Euler
and Lagrange description and present similar to Euler $C^2$ formulation of
continuous mechanics. In these general frameworks we consider as examples the
theory of plasma and gravitating gas.
