gradle - Process 'command 'C:\Program Files\Java\jdk\bin\java.exe'' 以非零退出值 1 eclipse 结束
问题描述
**Error :** Process 'command 'C:\Program Files\Java\jdk\bin\java.exe'' finished with non-zero exit value 1
当我运行 build.gradle 文件的任务时出现此错误,如下所示,
plugins {
id 'application'
id 'eclipse'
}
// remove the Javadoc verification
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
// Build version
version = '1.2.6-SNAPSHOT'
sourceCompatibility = '1.8'
artifactory {
publish {
repository.repoKey = 'ent-public-local-builds'
}
}
eclipse.classpath {
containers = containers.collect {
it.replace 'org.eclipse.jdt.launching.JRE_CONTAINER',
'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/DeveloperJavaJDK'
}
}
//Core Spring version numbers
def springVersion = '5.1.9.RELEASE'
def springBatchVersion = '4.1.2.RELEASE'
//Junit version
def junitVersion = '5.5.1'
//updated to use Transitive Dependencies
dependencies {
// include Spring JARs and dependencies
implementation 'org.springframework:spring-oxm:' + springVersion
implementation 'org.springframework:spring-webmvc:' + springVersion
}
reporting.baseDir = "my-reports"
testResultsDirName = "$buildDir/my-test-results"
application {
mainClassName = 'com.automation.MyClass'
}
task runWithJavaExec(type: JavaExec) {
// group = 'Execution'
// description = "Run the main class with JavaExecTask"
classpath = sourceSets.main.runtimeClasspath
main = 'com.automation.MyClass'
}
runWithJavaExec.onlyIf { project.hasProperty('Execution')}
我使用以下命令运行此任务,
gradle runWithJavaExec
最后,我想知道如何通过 gradle 命令运行 java 类?除了创建任务之外还有其他可能吗?如果是,请相应地分享。请帮我解决这个问题。
解决方案
如果您使用的是 intellij,只需使缓存无效并重新启动
推荐阅读
- reactjs - React useEffect 不会更改地图上显示的数据
- angular - 离子`
` 不适用于 domSanitizer,失败并显示“SafeValue must use [property]=binding” - firebase-storage - Firebase 存储规则 - 如何实现不同的读写规则
- prolog - 序言:反射(X,Y)->(Y,X)
- excel - 需要一个公式来根据输入计算范围
- scala - 更新 IntelliJ 后缺少依赖项
- asterisk - Asterisk Make Menu Select mysql_odbc 选项被禁用
- rest - 使用 softlayer REST API 在 IBM Cloud 中下新 VLAN 订单时如何获取 Vlan ID 详细信息
- express - zeit-now v2 + apollo-server-express:操场错误:无法访问服务器
- php - PHP 使用唯一的 SQL 值快速填充下拉列表