Win7 Eclipse environment to build spark java1.8: WordCount helloworld example

[Study notes]

Win7 Eclipse environment to build spark java1.8: WordCount helloworld example
to create a normal java project in eclipse oxygen, then the spark-assembly-1.6.1-hadoop2.6.0.jar guide into this package works ok. Just start the start-dfs, the following programs can be run.


COM Package;
Import java.util.Arrays;
Import java.util.List;
Import org.apache.spark.SparkConf;
Import org.apache.spark.api.java.JavaPairRDD;
Import org.apache.spark.api.java. JavaRDD;
Import org.apache.spark.api.java.JavaSparkContext;
Import org.apache.spark.api.java.function.FlatMapFunction;
Import org.apache.spark.api.java.function.Function2;
Import org.apache. spark.api.java.function.PairFunction;
Import org.apache.spark.api.java.function.VoidFunction;
Import scala.Tuple2;

public class WordCount1 {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf().setMaster("local").setAppName("wc");

Reprinted from the original article: https://blog.csdn.net/qq_44596980/article/details/93384785

Guess you like

Origin www.cnblogs.com/haima1949/p/11293712.html