Hello Stefan,
I am running openjdk 11.
I am not trying to build an android application. I am trying to build a java application that uses groovy, and java as the language. An application that has been created with gradle init, and choosing application, and java as the language.
Here is some more information from the log files. When I look at the ~/.gradle/daemon/6.8.3/daemon-224.out.log file (the file after I ran “gradle” without parameters in the project directory) says this:
2021-09-30T06:25:32.245+0000 [WARN] [org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment] Warning: Unable able to set daemon's environment variables to match the client because:
There is no native integration with this operating environment.
If the daemon was started with a significantly different environment from the client, and your build
relies on environment variables, you may experience unexpected behavior.
This line sounds serious. Not being able to “set the environment to match the client”
In this file there is only one line marked with [ERROR] is this. This line is prior the warning line given above.
2021-09-30T06:25:32.232+0000 [ERROR] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Command execution: started DaemonCommandExecution[command = Build{id=f1b0365a-6b37-4605-9ff3-3e63cc8c277a, currentDir=/home/rdindir/Documents/tests/gradle-java-app/src/main}, connection = DefaultDaemonConnection: socket connection from /127.0.0.1:65353 to /127.0.0.1:65352] after 0.0 minutes of idle
And the line that has the same output as the gradle invocation is this, in the log file.
2021-09-30T06:25:32.289+0000 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=72dbd7e8-0d6b-497a-97ee-176da686c324,javaHome=/usr/pkg/java/openjdk11,daemonRegistryDir=/home/rdindir/.gradle/daemon,pid=224,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=US-ASCII,-Duser.country=US,-Duser.language=en,-Duser.variant]
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not load compiled classes for build file '/home/rdindir/Documents/tests/gradle-java-app/src/main/app/build.gradle' from cache.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 13s
In this line, the memory settings 256 meg and 512 meg. Is this enough for a build? Or should these settings be more?
I tried with the --debug flag but the output seems the same. But tried also with --scan and -s flags (–debug flag was left out). Here gradle outputs
* What went wrong:
An exception occurred applying plugin request [id: 'com.gradle.enterprise', versio
n: '3.5', artifact: 'com.gradle:gradle-enterprise-gradle-plugin:3.5']
> Could not find implementation class 'com.gradle.enterprise.gradleplugin.GradleEnterprisePlugin' for plugin 'com.gradle.enterprise' specified in jar:file:/home/rdindir/.gradle/caches/jars-8/359a3903d392cf7b7f1750e93aa55cab/gradle-enterprise-gradle-plugin-3.5.jar!/META-INF/gradle-plugins/com.gradle.enterprise.properties.
And the stack output is (the very end) is like this
at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:132)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$applyLegacyPlugins$2(DefaultPluginRequestApplicator.java:138)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:176)
... 134 more
Caused by: java.lang.ClassNotFoundException: com.gradle.enterprise.gradleplugin.GradleEnterprisePlugin
at org.gradle.api.internal.plugins.DefaultPluginRegistry$1.load(DefaultPluginRegistry.java:72)
... 148 more
Caused by: java.io.EOFException: Detect premature EOF
at java.base/jdk.internal.loader.Resource.getBytes(Resource.java:131)
... 149 more
When I change the settings.gradle file and add “plugin { id ‘com.gradle.enterprise’ }” and the very beginning of the file and run the build, then it will complain with:
* What went wrong:
Could not load compiled classes for settings file '/home/rdindir/Documents/tests/gradle-java-app/src/main/settings.gradle' from cache.
> settings_afal2vv29jpydoto0c8vxvd22
This is what I have so far.
Regards,
Riza