General relativity in two dimensions: A Hamilton–Jacobi analysis