spark.sql.SqlContext等包找不到

博客讲述了在遇到`spark.sql.SqlContext`等包找不到的问题时,如何通过修改pom文件注释掉依赖包范围并重新导入依赖来解决问题。同时,提到了maven依赖范围的简单说明。
摘要由CSDN通过智能技术生成

##spark.sql.SqlContext等包找不到##

报错信息如下:

百度了很多,没有找到原因,后在一朋友指导下修复了该问题

解决方案

修改pom,

把依赖包的范围给注释掉

然后reimport dependencies

重新运行main示例,问题解决

关于maven依赖范围的几点补充:

scope:
This element refers to the classpath of the task at hand (compiling and runtime, testing, etc.) as well as how to limit the transitivity of a dependency. There are five scopes available:

compile - this is the default scope, used if none is specified. Compile dependencies are available in all classpaths. Furthermore, those dependencies are propagated to dependent projects.

provided - this is much like compile, but indicates you expect the JDK or a container to provide it at runtime. It is only available on the compi
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值