Could not determine java version from '11.0.1' when try to run gradle command
I am able to build my Android project from Android Studio. However, I am getting following error when I try to run a gradlew command. How can I resolve this?
admin:(my/branch)$ ./gradlew clean assembleDebug --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.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.
* Get more help at https://help.gradle.org
admin:(my/branch)$
This is my Java version:
admin:(my/branch)$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
java
add a comment |
I am able to build my Android project from Android Studio. However, I am getting following error when I try to run a gradlew command. How can I resolve this?
admin:(my/branch)$ ./gradlew clean assembleDebug --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.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.
* Get more help at https://help.gradle.org
admin:(my/branch)$
This is my Java version:
admin:(my/branch)$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
java
add a comment |
I am able to build my Android project from Android Studio. However, I am getting following error when I try to run a gradlew command. How can I resolve this?
admin:(my/branch)$ ./gradlew clean assembleDebug --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.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.
* Get more help at https://help.gradle.org
admin:(my/branch)$
This is my Java version:
admin:(my/branch)$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
java
I am able to build my Android project from Android Studio. However, I am getting following error when I try to run a gradlew command. How can I resolve this?
admin:(my/branch)$ ./gradlew clean assembleDebug --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.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.
* Get more help at https://help.gradle.org
admin:(my/branch)$
This is my Java version:
admin:(my/branch)$ java -version
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
java
java
edited Dec 14 '18 at 22:27
halfer
14.7k759116
14.7k759116
asked Nov 16 '18 at 0:58
HesamHesam
22.2k50171295
22.2k50171295
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Upgrade to Gradle 4.7.
The Release Notes says:
Fixed issues
46 issues have been fixed in Gradle 4.7.
- ...
- [#4515] - Support Java 11 Version Name
- ...
Thanks @Andreas for your answert. You are right. I just upgraded fromgradle-wrpper.propertisefile and I don't see the error. However, this time I see following error:admin:(my/branch)$ ./gradlew clean FAILURE: Build failed with an exception. * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().Have you seen such an issue?
– Hesam
Nov 16 '18 at 15:52
I uninstalled Java 11 and installed Java 8 instead. So, all complains are gone.
– Hesam
Dec 20 '18 at 15:35
add a comment |
You can either upgrade the Gradle version likes Andreas's answer or downgrade the java version if needed.
Follow the link to change JAVA_HOME to downgrade JAVA. How to set JAVA_HOME in Mac permanently?
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53329968%2fcould-not-determine-java-version-from-11-0-1-when-try-to-run-gradle-command%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Upgrade to Gradle 4.7.
The Release Notes says:
Fixed issues
46 issues have been fixed in Gradle 4.7.
- ...
- [#4515] - Support Java 11 Version Name
- ...
Thanks @Andreas for your answert. You are right. I just upgraded fromgradle-wrpper.propertisefile and I don't see the error. However, this time I see following error:admin:(my/branch)$ ./gradlew clean FAILURE: Build failed with an exception. * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().Have you seen such an issue?
– Hesam
Nov 16 '18 at 15:52
I uninstalled Java 11 and installed Java 8 instead. So, all complains are gone.
– Hesam
Dec 20 '18 at 15:35
add a comment |
Upgrade to Gradle 4.7.
The Release Notes says:
Fixed issues
46 issues have been fixed in Gradle 4.7.
- ...
- [#4515] - Support Java 11 Version Name
- ...
Thanks @Andreas for your answert. You are right. I just upgraded fromgradle-wrpper.propertisefile and I don't see the error. However, this time I see following error:admin:(my/branch)$ ./gradlew clean FAILURE: Build failed with an exception. * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().Have you seen such an issue?
– Hesam
Nov 16 '18 at 15:52
I uninstalled Java 11 and installed Java 8 instead. So, all complains are gone.
– Hesam
Dec 20 '18 at 15:35
add a comment |
Upgrade to Gradle 4.7.
The Release Notes says:
Fixed issues
46 issues have been fixed in Gradle 4.7.
- ...
- [#4515] - Support Java 11 Version Name
- ...
Upgrade to Gradle 4.7.
The Release Notes says:
Fixed issues
46 issues have been fixed in Gradle 4.7.
- ...
- [#4515] - Support Java 11 Version Name
- ...
answered Nov 16 '18 at 1:13
AndreasAndreas
78.5k464129
78.5k464129
Thanks @Andreas for your answert. You are right. I just upgraded fromgradle-wrpper.propertisefile and I don't see the error. However, this time I see following error:admin:(my/branch)$ ./gradlew clean FAILURE: Build failed with an exception. * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().Have you seen such an issue?
– Hesam
Nov 16 '18 at 15:52
I uninstalled Java 11 and installed Java 8 instead. So, all complains are gone.
– Hesam
Dec 20 '18 at 15:35
add a comment |
Thanks @Andreas for your answert. You are right. I just upgraded fromgradle-wrpper.propertisefile and I don't see the error. However, this time I see following error:admin:(my/branch)$ ./gradlew clean FAILURE: Build failed with an exception. * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().Have you seen such an issue?
– Hesam
Nov 16 '18 at 15:52
I uninstalled Java 11 and installed Java 8 instead. So, all complains are gone.
– Hesam
Dec 20 '18 at 15:35
Thanks @Andreas for your answert. You are right. I just upgraded from
gradle-wrpper.propertise file and I don't see the error. However, this time I see following error:admin:(my/branch)$ ./gradlew clean FAILURE: Build failed with an exception. * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy(). Have you seen such an issue?– Hesam
Nov 16 '18 at 15:52
Thanks @Andreas for your answert. You are right. I just upgraded from
gradle-wrpper.propertise file and I don't see the error. However, this time I see following error:admin:(my/branch)$ ./gradlew clean FAILURE: Build failed with an exception. * What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy(). Have you seen such an issue?– Hesam
Nov 16 '18 at 15:52
I uninstalled Java 11 and installed Java 8 instead. So, all complains are gone.
– Hesam
Dec 20 '18 at 15:35
I uninstalled Java 11 and installed Java 8 instead. So, all complains are gone.
– Hesam
Dec 20 '18 at 15:35
add a comment |
You can either upgrade the Gradle version likes Andreas's answer or downgrade the java version if needed.
Follow the link to change JAVA_HOME to downgrade JAVA. How to set JAVA_HOME in Mac permanently?
add a comment |
You can either upgrade the Gradle version likes Andreas's answer or downgrade the java version if needed.
Follow the link to change JAVA_HOME to downgrade JAVA. How to set JAVA_HOME in Mac permanently?
add a comment |
You can either upgrade the Gradle version likes Andreas's answer or downgrade the java version if needed.
Follow the link to change JAVA_HOME to downgrade JAVA. How to set JAVA_HOME in Mac permanently?
You can either upgrade the Gradle version likes Andreas's answer or downgrade the java version if needed.
Follow the link to change JAVA_HOME to downgrade JAVA. How to set JAVA_HOME in Mac permanently?
answered Nov 27 '18 at 15:48
Allen WangAllen Wang
545410
545410
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53329968%2fcould-not-determine-java-version-from-11-0-1-when-try-to-run-gradle-command%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown