Abstract: The $H^1$-stability of an L2 method on general nonuniform meshes is established for the subdiffusion equation. Under some mild constraints on the time step ratio ,a crucial bilinear form associated with the L2 fractional-derivative operator is proved to be positive semidefinite. As a consequence, the long time $H^1$-stability of L2 schemes can be derived for the subdiffusion equation.