added a new method for creating JavaSparkContext