A Gradle task classesPipeline is being run in Eclipse. This task assembles .class files by depending on the standard classes task, then attempts executing a batchfile.
All goes fine until the batchfile, where the script dies a horrible death in Eclipse, by printing to console:
Execution failed for task ':classesPipeline'.
> A problem occurred starting process 'command '../SomeFolder/SomeBatchfile.bat''
* 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.
The log suggests to run the task with --stacktrace, but how do I do this?
So I checked the project settings, the Gradle section offers no command line arguments, as far as i see. It is noteworthy, that running the task with --stacktrace via gradlew is of no value to me, because the task executes just fine in this case, this is only happening in Eclipse specifically.
TL;DR:
How can a gradle task be executed from Eclipse, while passing arguments to it?
To anyone who may come into contact with this problem:
I found the solution in a different, but closely related question:
How can I make "gradle --stacktrace" the default?
It is sufficient to add the following to the build.gradle:
gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.ALWAYS
Related
Task :react-native-gradle-plugin:compileKotlin FAILED
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version.
1 actionable task: 1 executed
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-gradle-plugin:compileKotlin'.
Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRunner$kotlin_gradle_plugin'.
Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is
running on a JDK, not JRE.
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 31s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-gradle-plugin:compileKotlin'.
Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRunner$kotlin_gradle_plugin'.
Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is
running on a JDK, not JRE.
Download and install JDK
you can check this link for more help:
https://github.com/Jire/Charlatano/issues/854
Try:
rm -rf ./node_modules
yarn
npm run android
I try to upload my test package firebase App Distribution by using
./gradlew assembleAlphaDebug appDistributionUploadAlphaDebug code snippet through android studio terminal, 5 days before I updated my java version and then I have started getting this error. I have not come across any solution until now.
FAILURE: Build failed with an exception.
What went wrong:
Could not determine java version from '15.0.1'.
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.
If you are using Mac, follow these steps:
vi ~/.bash_profile
Add in JAVA_HOME path there
export JAVA_HOME=/opt/bdc/opt/jdk
Save :wq
Execute source ~/.bash-profile
Once done do echo $JAVA_Home
and try your next steps.
I can't run the command .-gradlew setupDecomWorkspace in PowerShell, I get this error, help and thanks :)
FAILURE: Build failed with an exception.
What went wrong:
Could not determine java version from '14'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
PS C:\Users\Green\Desktop\forge-1.12.2-14.23.5.2768-mdk>
I am currently trying to run an emulator on Android on my Mac PC through Cordova. But it seems like I always get issue and it always comes down to Java Environment possibly not being correct. When I try to do either a build or a emulate, I get the following error:
Error: /cordova_app_directory/platforms/android/gradlew: Command failed with exit code 1 Error
output:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '9.0.1'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
I have gone through multiple ways of trying to fix this. This includes updating java development enviroment (which its 10.0.1) and also update Gradle (which is 4.4). I also tried removing and re-adding the platform back in but it doesn't work.
Does anyone have any idea of what could be causing this issue?
I'm running Gradle 3.2.1 on MacOS X 10.12.1 installed with brew install gradle, did not set any env variables etc. myself, trying to use the Java 9 EA:
gradle build -Dorg.gradle.java.home=~/jdk-9.jdk/Contents/Home
But the build is failing with
FAILURE: Build failed with an exception.
What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example,
an unrecognized jvm option is used.
From what I know it fails because the daemon is trying to use the maxpermsize JVM option (which is not supported in Java 8+ but in Java 8 it's only a warning).
So I tried to disable the daemon:
mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
But gradle build is still trying to start a daemon... I removed ~/.gradle and .gradle in the project directory. Any other ideas?
$ gradle build -Dorg.gradle.daemon=false -Dorg.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/3.2.1/userguide/gradle_daemon.html.
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/3.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.ExceptionInInitializerError (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
> Starting Daemon%
Ok so I figured it out, since I'm running my build like this:
gradle build -Dorg.gradle.java.home=~/jdk-9.jdk/Contents/Home
Gradle has to spawn a new thread to use a different Java version than the one pointed to by JAVA_HOME. This is done by spawning a daemon thread (even despite the false option) with that Java version and is failing. The same would happen if I passed JVM args to the build apparently.
The solution is to instead set JAVA_HOME in the terminal export JAVA_HOME=~/jdk-9.jdk/Contents/Home and just run gradle build.
Still doesn't work because the newest Java9 build broke Gradle's reflection but that's a different story.
I am posting this here since it's too big of a comment (but it is for sure not an answer).
If you run your script with --debug you will see the underlying error. I am running this directly via java-9 without setting the JAVA_HOME btw.
I had the same issue a few jdk-9 builds back and tackled it with:
set _JAVA_OPTIONS "-Dsun.reflect.debugModuleAccessChecks=true
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED"
set instead of export because I'm using fish, but should work for bash the same way.
Interestingly enough this still fails with build 153 with this:
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Map java.util.Collections$UnmodifiableMap.m accessible: module java.base does not "opens java.util" to unnamed module #67080771
But that is specified within _JAVA_OPTIONS. This might be a regression on build 153.