This paper proposes a novel superpixel-based method for the classification of hyperspectral image. A superpixel segmentation algorithm called entropy rate superpixel is applied to extract the spatial contextual information in the hyperspectral image, which can change the size and shape of the superpixel adaptively according to spatial structures. Then, a joint sparse representation model is applied to approximate the pixels within each superpixel using a certain number of common samples from a given dictionary in the form of sparse linear combination. Here we use a greedy algorithm called simultaneous orthogonal matching pursuit to pursue the optimal sparse coefficients matrix and a new kind of classification criterion is tested and used to determine the classification results. Experimental results on the Indian Pines hyperspsectral image demonstrate that the proposed method can explore the spatial information effectively and give promising performance when compared with several state-of-art classification methods.