将mapreduce代码打包扔到服务器上,运行jar,报错:
Exception in thread "main" java.lang.ClassNotFoundException: src.etl.VideoETLRunner.java
打包之前,maven需要加一个配置:
(build这块一定要配置,否则打jar的时候会说找不到主类)
(类限定名不要写错,不然执行的时候就会报异常Exception in thread “main” java.lang.ClassNotFoundException)
<build>
<plugins>
<plugin>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-maven-pluginartifactId>
<version>2.5.10version>
<configuration>
<mainClass>src/etl/VideoETLRunner.javamainClass>
configuration>
plugin>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-compiler-pluginartifactId>
<configuration>
<source>7source>
<target>7target>
configuration>
plugin>
plugins>
build>
mapreduce跑起来,success!
成功解决!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)