Eclipse 插件开发 - Gradle 无法从 Eclipse 启动器运行:java.io.IOException:访问被拒绝

Eclipse plugin development - Gradle fails to run from Eclipse launcher: java.io.IOException: Access denied(Eclipse 插件开发 - Gradle 无法从 Eclipse 启动器运行:java.io.IOException:访问被拒绝)

本文介绍了Eclipse 插件开发 - Gradle 无法从 Eclipse 启动器运行:java.io.IOException:访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 Eclipse 插件来运行 Gradle 从 Eclipse 中作为一个应用程序(使用 Eclipse LaunchConfiguration).但是即使在为这个新进程设置了 JAVA_HOMEGRADLE_HOME 之后,它也会以错误结束.以下是我通过传递额外的 --debug --stacktrace

I am developing Eclipse plugin to run Gradle from Eclipse just as an application (using Eclipse LaunchConfiguration). But even after setting JAVA_HOME and GRADLE_HOME for this new process, it finishes with error. Below is what I got by passing additional --debug --stacktrace

那么对于什么文件访问被拒绝以及如何发现呢?

21:50:18.828 [ERROR] [org.gradle.BuildExceptionReporter] 
21:50:18.828 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter] 
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter] java.lang.ExceptionInInitializerError (no error message)
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter] 
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter] java.lang.ExceptionInInitializerError
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.FileSystems.getDefault(FileSystems.java:22)
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.LayoutCommandLineConverter.convert(LayoutCommandLineConverter.java:39)
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.BuildActionsFactory.createAction(BuildActionsFactory.java:107)
21:50:18.844 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.createAction(CommandLineActionFactory.java:206)
21:50:18.859 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:196)
21:50:18.859 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.doAction(Main.java:46)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.main(Main.java:37)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.RuntimeException: java.io.IOException: Access denied
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.GenericFileSystem.<init>(GenericFileSystem.java:88)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.FileSystems$DefaultFileSystem.<clinit>(FileSystems.java:30)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    ... 16 more
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Access denied
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.GenericFileSystem.createFile(GenericFileSystem.java:99)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.nativeplatform.filesystem.GenericFileSystem.<init>(GenericFileSystem.java:84)
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter]    ... 17 more
21:50:18.860 [ERROR] [org.gradle.BuildExceptionReporter] 

Eclipse 在 Win32 上使用 JRE 1.7 启动

Eclipse is launched with JRE 1.7 on Win32

Gradle 1.10.当然,命令行 shell 也是如此.

Gradle 1.10. Of course the same works from command line shell.

推荐答案

发现这一点的方法是查看 Gradle 代码库.IOException 由以下行引发:

The way to discover this is to look into the Gradle codebase. The IOException is thrown by the following line:

File file = File.createTempFile("gradle_fs_probing", null, null);

显然,Java 进程无法创建临时文件.也许这是一个文件权限问题.

So apparently, the Java process isn't able to create a temporary file. Perhaps this is a file permission issue.

这篇关于Eclipse 插件开发 - Gradle 无法从 Eclipse 启动器运行:java.io.IOException:访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Eclipse 插件开发 - Gradle 无法从 Eclipse 启动器运行:java.io.IOException:访问被拒绝

基础教程推荐