Gradle Create Project (IntelliJ IDEA)

Create Gradle project

step one:

 

 Step 2:

 

 Step 3:

 

 Step 4:

 

 Step 5:

At this point, the project has been built. If it is used for the first time, or if there is no local version of Gradle, the download will be triggered. As shown in the figure.

Click the process running marked in the red box to view the task progress.

 

 Step 6:

After clicking process running in step 5, you can see the progress of the task. For example, the current version I downloaded is Gradle-4.4, and it took more than ten minutes to download more than 3M...very slow.... If you have patience, you can continue to wait. Go down.... If you have no patience, you can read Step 7.

 

Step seven:

Close the Gradle project you just created. (Close, not delete)

If a Gradle related window pops up when closing, just click Cancel to force the close.

Copy the address circled by the red box in step 6 https://services.gradle.org/distributions/gradle-4.4-bin.zip to Thunder... Download it with Thunder... Download it in a few minutes ....

 

Step 8 (For Mac students, please refer to Step 8, for Windows students, please refer to Step 9):

Go to the ~/.gradle/wrapper/dists/gradle-4.4-bin/ folder (see the version clearly, adjust it according to the Gradle version prompted in your IDEA), then "ll" to view the current directory, you will find a A folder with a "very random" name, mine is bgaq7vklkazwgxox0hdadxbvi (everyone's is different)

 

 Go into a folder with an arbitrary name (probably a hash value).

Then execute "ll" to view the current directory. 

Move the gradle-4.4-bin.zip you just downloaded to the ~/.gradle/wrapper/dists/gradle-4.4-bin/bgaq7vklkazwgxox0hdadxbvi/ directory. (Students make appropriate modifications according to their own situation. Do not paste this path directly. . will be wrong.. Note that the version number is not necessarily the same, note that the file name named after the Hash value is different for everyone)

mv ~/Downloads/gradle-4.4-bin.zip ~/.gradle/wrapper/dists/gradle-4.4-bin/bgaq7vklkazwgxox0hdadxbvi/

Then use the unzip command to unzip the zip package:

unzip ~/.gradle/wrapper/dists/gradle-4.4-bin/bgaq7vklkazwgxox0hdadxbvi/gradle-4.4-bin.zip

  

Delete the file gradle-4.4-bin.zip.part, and then create an empty file named gradle-4.4-bin.zip.ok, as shown in the following figure:

 

Then open the Gradle project you just created, and this will appear in the lower right corner after opening:

That means, the left side is to import this time, and the right side is that the project will be automatically imported in the future, it doesn't matter....

 

Then if the status bar below IDEA indicates that there is a task running (proccess running, which is the position of the red box in step 6), it is best to click it and see, if it is "Gradle: wait for another thread xxxxxxxx", it probably means Say that he is waiting for another thread's lock, it will run endlessly, and your Gradle is not available, then it is recommended that you restart your computer at this time . Re-open IDEA. (Actually, killing a thread will do, but I can not find it)

 

After restarting, open idea, and after importing IDEA, it becomes such a directory structure.

 

It's different from what you imagined, right? At this time, you need to follow the previous steps to build a new project. For example, let's build another project: GradleDemo8, which will look like this after it is built:

 

Step 9 (For Mac students, please refer to Step 8, for Windows students, please refer to Step 9):

I don't have a windows system here, just put a link https://blog.csdn.net/lusyoe/article/details/54837357 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325731550&siteId=291194637
Recommended