In this paper, we study the underlying geometry in the classical Hamilton-Jacobi theory. The proposed formalism is also valid for nonholonomic systems. We first introduce the essential geometric ingredients: a vector bundle, a linear almost Poisson structure and a Hamiltonian function, both on the dual bundle (a Hamiltonian system). From them, it is possible to formulate the Hamilton-Jacobi the...