近期接手一个老项目,启动报错:CreateProcess error=206, 文件名或扩展名太长
这是因为Windows命令行支持的字符串长度有限制。Linux不会有这个问题。
如果你是使用的gradle的bootrun
方式启动,那么可以参考gradle官方文档 来解决这个问题,引入插件。
方式一:Using the plugins DSL
plugins {
id "ua.eshepelyuk.ManifestClasspath" version "1.0.0"
}
方式二:Using legacy plugin application
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.ua.eshepelyuk:ManifestClasspath:1.0.0"
}
}
apply plugin: "ua.eshepelyuk.ManifestClasspath"
如果是使用的maven或者直接启动的springboot的启动类,则只需要修改idea中的配置即可:Shorten command line
选第三个选项JAR manifest -java.....
.