Could not determine java version from '11.0.1' when try to run gradle command










2















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)









share|improve this question




























    2















    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)









    share|improve this question


























      2












      2








      2








      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)









      share|improve this question
















      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 android android-gradle






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 14 '18 at 22:27









      halfer

      14.7k759116




      14.7k759116










      asked Nov 16 '18 at 0:58









      HesamHesam

      22.2k50171295




      22.2k50171295






















          2 Answers
          2






          active

          oldest

          votes


















          3














          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

          • ...






          share|improve this answer























          • 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


















          1














          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?






          share|improve this answer






















            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
            );



            );













            draft saved

            draft discarded


















            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









            3














            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

            • ...






            share|improve this answer























            • 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















            3














            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

            • ...






            share|improve this answer























            • 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













            3












            3








            3







            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

            • ...






            share|improve this answer













            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

            • ...







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 16 '18 at 1:13









            AndreasAndreas

            78.5k464129




            78.5k464129












            • 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

















            • 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
















            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













            1














            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?






            share|improve this answer



























              1














              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?






              share|improve this answer

























                1












                1








                1







                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?






                share|improve this answer













                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?







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 27 '18 at 15:48









                Allen WangAllen Wang

                545410




                545410



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    27

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    Category:Rhetoric