概述
问题一:CreateProcess error=206, 文件名或扩展名太长
版本:
idea:2021.3.3
gradel:4.10.3
scala:2.12.12
git
场景描述:
在运行main方法时报错,报错内容如下:
问题原因:
引起这个错误的主要原因是java启动时带的启动参数超过了window的最大长度限制导致的,而Linux却不对这个做限制,所以一般踩坑的都是win开发环境的用户。
解决方案:
Run—Edit Configuration中找到Shorten command line这个选项,如果你找不到,尝试从Modify options选项中调出:
- none:这是默认选项,idea不会缩短命令行。如果命令行超出了OS限制,这个想法将无法运行您的应用程序,但是工具提示将建议配置缩短器。
- JAR manifest:idea 通过临时的classpath.jar传递长的类路径。原始类路径在MANIFEST.MF中定义为classpath.jar中的类路径属性。
- classpath file:idea 将一个长类路径写入文本文件中。
选择JAR manifest选项。
问题二:No tests found for given includes
版本:
idea:2021.3.3
gradel:4.10.3
scala:2.12.12
git
场景描述:
使用idea运行时候发生报错:No tests found for given includes,报错内容如下:
问题原因:
这是由于点击单元测试使用了idea的按钮时候,idea默认使用了gradle的测试运行期,如果gradle的编译脚本没有进行相关配置,则会发生上述报错。
解决方案:
方案一:
gradle编译脚本添加test编译器配置,如下所示
test {
useJUnitPlatform()
}
方案二:
使用idea自带的测试运行期,具体配置如下所示:
问题三:Error running ReadDDL.create table. Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun
版本:
idea:2021.3.3
gradel:4.10.3
scala:2.12.12
git
场景描述:
项目单元测试使用junit,发生报错,报错内容如下:
解决方案:
方法一:Edit Configurations,将默认的Shorten command line的值user-local default 改为 JAR mainifest 或者 classpath file(这种办法需要对每个类单独设置)
方法二:在项目的.idea/workspace.xml文件中,找到<component name="PropertiesComponent">,后面在添加一行<property name="dynamic.classpath" value="true" />(此方式一次设置就可)
问题四:A master URL must be set in your configuration
版本:
idea:2021.3.3
gradel:4.10.3
scala:2.12.12
git
场景描述:
代码执行前没有初始化SparkContext,错误如下:
解决方案:
在Configuration中添加虚拟机设置
最后
以上就是发嗲书包为你收集整理的idea开发遇到的问题整理问题一:CreateProcess error=206, 文件名或扩展名太长问题二:No tests found for given includes问题三:Error running ReadDDL.create table. Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun问题四:A master URL must的全部内容,希望文章能够帮你解决idea开发遇到的问题整理问题一:CreateProcess error=206, 文件名或扩展名太长问题二:No tests found for given includes问题三:Error running ReadDDL.create table. Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun问题四:A master URL must所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复