In this paper, we use Legendre–Fenchel transform and a space decomposition to carry out Fountain theorem and dual Fountain theorem for the following elliptic system of Hamiltonian type: \( {\left\{ \begin{array}{ll} \begin{aligned} -\Delta u& =H_v(u, v) \,\quad & & \text {in}~\Omega ,\\ -\Delta v& =H_u(u, v) \,\quad & & \text {in}~\Omega ,\\ u,\,v& =0~~& & \text {on} ~ \partial \Omega ,\\ \end{aligned} \end{array}\right. } \) where \(N\ge 1\) , \(\Omega \subset \mathbb {R}^N\) is a bounded domain and \(H\in C^1( \mathbb {R}^2)\) is strictly convex, even and subcritical. We mainly present two results: (i) When H is superlinear, the system has infinitely many solutions, whose energies tend to infinity. (ii) When H is sublinear, the system has infinitely many solutions, whose energies are negative and tend to 0. As a byproduct, the Lane–Emden system under subcritical growth has infinitely many solutions.