Could not determine java version from '15.0.1' - java

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.

Related

How do i set up java 16 on ubuntu 18.04

I am trying to make Minecraft mods with Fabric, but when I run ./gradlew genSources, I get this error:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/andrew/Desktop/Minecraft Mods/TEST/build.gradle' line: 2
* What went wrong:
An exception occurred applying plugin request [id: 'fabric-loom', version: '0.8-SNAPSHOT']
> Failed to apply plugin 'fabric-loom'.
> You are using an outdated version of Java (11). Java 16 or higher is required.
* 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 701ms
I uninstalled java 11 and installed java 16 with the deb file from https://www.oracle.com/java/technologies/javase-jdk16-downloads.html. Once I do that, I get this error when running ./gradlew genSources:
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
How do I fix this? Here is the tutorial I am following: https://www.youtube.com/watch?v=_JZ7bnk3oiM

Generating build from the terminal is failing, but it's working from the "Run App" option(When clicking the "Run App")

When I'm trying to build the project from the terminal it's keep failing.
kaptDebugKotlin failed
I suspect that something wrong with Java JDK path. But I set the java_home in both bash file and Android studio.
I set the JDK1.8 home as java_home and JDK location in Android Studio.
NB: I'm using Mac.
Add this to gradle.properties:
org.gradle.java.home=<JDK location>
Also check exact problem with these commands:
--stacktrace --info --scan

Java problem in PowerShell 'Could not determine jave version from '14'

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>

Stacktrace option for Gradle task in Eclipse

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

Cordova Emulating/Building Android always returning Gradle Error

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?

Categories