How to install gradle and gradlew?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












I'm having a problem installing gradlew... I can use the gradle command by simply typing "gradle" in the Terminal, but "gradlew" doesn't do anything. I installed gradle using



sudo apt install gradle


And it installed successfully. I have to use "sudo gradle" and not "gradle" because this shows up when I don't use sudo.



icebunny08@D3CRYPT3D:~$ gradle
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/usr/share/gradle/lib/gradle-base-services-3.4.1.jar) to method java.lang.ClassLoader.getPackages()
WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Starting a Gradle Daemon (subsequent builds will be faster)
:help

Welcome to Gradle 3.4.1.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

BUILD SUCCESSFUL

Total time: 5.017 secs


My problems are if I installed Gradle correctly, and why can't I use the "gradlew" command. This is the output when I use "gradlew".



icebunny08@D3CRYPT3D:~$ gradlew

Command 'gradlew' not found, did you mean:

command 'gradle' from deb gradle

Try: sudo apt install <deb name>






share|improve this question























    up vote
    1
    down vote

    favorite












    I'm having a problem installing gradlew... I can use the gradle command by simply typing "gradle" in the Terminal, but "gradlew" doesn't do anything. I installed gradle using



    sudo apt install gradle


    And it installed successfully. I have to use "sudo gradle" and not "gradle" because this shows up when I don't use sudo.



    icebunny08@D3CRYPT3D:~$ gradle
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/usr/share/gradle/lib/gradle-base-services-3.4.1.jar) to method java.lang.ClassLoader.getPackages()
    WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release
    Starting a Gradle Daemon (subsequent builds will be faster)
    :help

    Welcome to Gradle 3.4.1.

    To run a build, run gradle <task> ...

    To see a list of available tasks, run gradle tasks

    To see a list of command-line options, run gradle --help

    To see more detail about a task, run gradle help --task <task>

    BUILD SUCCESSFUL

    Total time: 5.017 secs


    My problems are if I installed Gradle correctly, and why can't I use the "gradlew" command. This is the output when I use "gradlew".



    icebunny08@D3CRYPT3D:~$ gradlew

    Command 'gradlew' not found, did you mean:

    command 'gradle' from deb gradle

    Try: sudo apt install <deb name>






    share|improve this question





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm having a problem installing gradlew... I can use the gradle command by simply typing "gradle" in the Terminal, but "gradlew" doesn't do anything. I installed gradle using



      sudo apt install gradle


      And it installed successfully. I have to use "sudo gradle" and not "gradle" because this shows up when I don't use sudo.



      icebunny08@D3CRYPT3D:~$ gradle
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/usr/share/gradle/lib/gradle-base-services-3.4.1.jar) to method java.lang.ClassLoader.getPackages()
      WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release
      Starting a Gradle Daemon (subsequent builds will be faster)
      :help

      Welcome to Gradle 3.4.1.

      To run a build, run gradle <task> ...

      To see a list of available tasks, run gradle tasks

      To see a list of command-line options, run gradle --help

      To see more detail about a task, run gradle help --task <task>

      BUILD SUCCESSFUL

      Total time: 5.017 secs


      My problems are if I installed Gradle correctly, and why can't I use the "gradlew" command. This is the output when I use "gradlew".



      icebunny08@D3CRYPT3D:~$ gradlew

      Command 'gradlew' not found, did you mean:

      command 'gradle' from deb gradle

      Try: sudo apt install <deb name>






      share|improve this question











      I'm having a problem installing gradlew... I can use the gradle command by simply typing "gradle" in the Terminal, but "gradlew" doesn't do anything. I installed gradle using



      sudo apt install gradle


      And it installed successfully. I have to use "sudo gradle" and not "gradle" because this shows up when I don't use sudo.



      icebunny08@D3CRYPT3D:~$ gradle
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.gradle.internal.reflect.JavaMethod (file:/usr/share/gradle/lib/gradle-base-services-3.4.1.jar) to method java.lang.ClassLoader.getPackages()
      WARNING: Please consider reporting this to the maintainers of org.gradle.internal.reflect.JavaMethod
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release
      Starting a Gradle Daemon (subsequent builds will be faster)
      :help

      Welcome to Gradle 3.4.1.

      To run a build, run gradle <task> ...

      To see a list of available tasks, run gradle tasks

      To see a list of command-line options, run gradle --help

      To see more detail about a task, run gradle help --task <task>

      BUILD SUCCESSFUL

      Total time: 5.017 secs


      My problems are if I installed Gradle correctly, and why can't I use the "gradlew" command. This is the output when I use "gradlew".



      icebunny08@D3CRYPT3D:~$ gradlew

      Command 'gradlew' not found, did you mean:

      command 'gradle' from deb gradle

      Try: sudo apt install <deb name>








      share|improve this question










      share|improve this question




      share|improve this question









      asked Jun 7 at 4:46









      icebunny08

      466




      466




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The warnings you have when running gradle command are due to some groovy issue with JDK 9 or later, as described here.



          If these warnings are a problem for you, you can use the described workaround to make them disapear:




          You can add the following arguments to java bootstrap script or JAVA_OPTS to suppress this warning:



          --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED





          Now about gradlew.



          Gradlew is a wrapper around gradle. It is bound to a project, not to your workstation. In other words, each gradle project you develop could have a graddle wrapper coming with it.
          The purpose of gradlew is to make the project portable (i.e. developers don't need to install gradle on their workstation) and reliable (i.e. same version of gradle for everyone).
          The wrapper script will download the specified version of gradle for your project, then run it. This is all described in their documentation.



          What you have done in your case is installing gradle on your workstation, globally. the gradle installation doesn't come with gradlew, as gradlew needs to be added to every gradle project of your choice, as described here. You simply have to run the following command in your project:



          gradle wrapper


          This will create the wrapper script for your gradle project. Obviously you need gradle to be installed to run this command (you installed it already), but if you commit the result and share it with other developers, they can use the gradlew script without installing gradle.



          In your case, you end up with two possibilities:



          • run gradle commands in your project, like gradle clean. You can do this because you manually installed gradle globally

          • run gradlew commands in your project, like gradlew clean. You can do this because you created the wrapper script with gradle wrapper in the first place.

          Both should give the same result if the gradle version is the same.






          share|improve this answer





















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1044352%2fhow-to-install-gradle-and-gradlew%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            The warnings you have when running gradle command are due to some groovy issue with JDK 9 or later, as described here.



            If these warnings are a problem for you, you can use the described workaround to make them disapear:




            You can add the following arguments to java bootstrap script or JAVA_OPTS to suppress this warning:



            --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED





            Now about gradlew.



            Gradlew is a wrapper around gradle. It is bound to a project, not to your workstation. In other words, each gradle project you develop could have a graddle wrapper coming with it.
            The purpose of gradlew is to make the project portable (i.e. developers don't need to install gradle on their workstation) and reliable (i.e. same version of gradle for everyone).
            The wrapper script will download the specified version of gradle for your project, then run it. This is all described in their documentation.



            What you have done in your case is installing gradle on your workstation, globally. the gradle installation doesn't come with gradlew, as gradlew needs to be added to every gradle project of your choice, as described here. You simply have to run the following command in your project:



            gradle wrapper


            This will create the wrapper script for your gradle project. Obviously you need gradle to be installed to run this command (you installed it already), but if you commit the result and share it with other developers, they can use the gradlew script without installing gradle.



            In your case, you end up with two possibilities:



            • run gradle commands in your project, like gradle clean. You can do this because you manually installed gradle globally

            • run gradlew commands in your project, like gradlew clean. You can do this because you created the wrapper script with gradle wrapper in the first place.

            Both should give the same result if the gradle version is the same.






            share|improve this answer

























              up vote
              0
              down vote













              The warnings you have when running gradle command are due to some groovy issue with JDK 9 or later, as described here.



              If these warnings are a problem for you, you can use the described workaround to make them disapear:




              You can add the following arguments to java bootstrap script or JAVA_OPTS to suppress this warning:



              --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED





              Now about gradlew.



              Gradlew is a wrapper around gradle. It is bound to a project, not to your workstation. In other words, each gradle project you develop could have a graddle wrapper coming with it.
              The purpose of gradlew is to make the project portable (i.e. developers don't need to install gradle on their workstation) and reliable (i.e. same version of gradle for everyone).
              The wrapper script will download the specified version of gradle for your project, then run it. This is all described in their documentation.



              What you have done in your case is installing gradle on your workstation, globally. the gradle installation doesn't come with gradlew, as gradlew needs to be added to every gradle project of your choice, as described here. You simply have to run the following command in your project:



              gradle wrapper


              This will create the wrapper script for your gradle project. Obviously you need gradle to be installed to run this command (you installed it already), but if you commit the result and share it with other developers, they can use the gradlew script without installing gradle.



              In your case, you end up with two possibilities:



              • run gradle commands in your project, like gradle clean. You can do this because you manually installed gradle globally

              • run gradlew commands in your project, like gradlew clean. You can do this because you created the wrapper script with gradle wrapper in the first place.

              Both should give the same result if the gradle version is the same.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                The warnings you have when running gradle command are due to some groovy issue with JDK 9 or later, as described here.



                If these warnings are a problem for you, you can use the described workaround to make them disapear:




                You can add the following arguments to java bootstrap script or JAVA_OPTS to suppress this warning:



                --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED





                Now about gradlew.



                Gradlew is a wrapper around gradle. It is bound to a project, not to your workstation. In other words, each gradle project you develop could have a graddle wrapper coming with it.
                The purpose of gradlew is to make the project portable (i.e. developers don't need to install gradle on their workstation) and reliable (i.e. same version of gradle for everyone).
                The wrapper script will download the specified version of gradle for your project, then run it. This is all described in their documentation.



                What you have done in your case is installing gradle on your workstation, globally. the gradle installation doesn't come with gradlew, as gradlew needs to be added to every gradle project of your choice, as described here. You simply have to run the following command in your project:



                gradle wrapper


                This will create the wrapper script for your gradle project. Obviously you need gradle to be installed to run this command (you installed it already), but if you commit the result and share it with other developers, they can use the gradlew script without installing gradle.



                In your case, you end up with two possibilities:



                • run gradle commands in your project, like gradle clean. You can do this because you manually installed gradle globally

                • run gradlew commands in your project, like gradlew clean. You can do this because you created the wrapper script with gradle wrapper in the first place.

                Both should give the same result if the gradle version is the same.






                share|improve this answer













                The warnings you have when running gradle command are due to some groovy issue with JDK 9 or later, as described here.



                If these warnings are a problem for you, you can use the described workaround to make them disapear:




                You can add the following arguments to java bootstrap script or JAVA_OPTS to suppress this warning:



                --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED





                Now about gradlew.



                Gradlew is a wrapper around gradle. It is bound to a project, not to your workstation. In other words, each gradle project you develop could have a graddle wrapper coming with it.
                The purpose of gradlew is to make the project portable (i.e. developers don't need to install gradle on their workstation) and reliable (i.e. same version of gradle for everyone).
                The wrapper script will download the specified version of gradle for your project, then run it. This is all described in their documentation.



                What you have done in your case is installing gradle on your workstation, globally. the gradle installation doesn't come with gradlew, as gradlew needs to be added to every gradle project of your choice, as described here. You simply have to run the following command in your project:



                gradle wrapper


                This will create the wrapper script for your gradle project. Obviously you need gradle to be installed to run this command (you installed it already), but if you commit the result and share it with other developers, they can use the gradlew script without installing gradle.



                In your case, you end up with two possibilities:



                • run gradle commands in your project, like gradle clean. You can do this because you manually installed gradle globally

                • run gradlew commands in your project, like gradlew clean. You can do this because you created the wrapper script with gradle wrapper in the first place.

                Both should give the same result if the gradle version is the same.







                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered Jun 7 at 6:17









                O Ducarme

                11




                11






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1044352%2fhow-to-install-gradle-and-gradlew%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Cutting all the characters after the last /