runningcode / gradle-doctor

The right prescription for your Gradle build.
http://runningcode.github.io/gradle-doctor
Apache License 2.0
736 stars 48 forks source link

Bug: Error while trying on Windows, without a good quick-fix #140

Closed AndroidDeveloperLB closed 3 years ago

AndroidDeveloperLB commented 3 years ago

All I did is add this , and then trying to build:

    id "com.osacky.doctor" version "0.7.0"

This is what I get, and it thinks I should fix it using Linux/Unix commands:

A problem occurred configuring root project 'My Application'.
> =============================== Gradle Doctor Prescriptions ============================================
  | JAVA_HOME is not set.
                                                                               |
  | Please set JAVA_HOME so that switching between Android Studio and the terminal does not trigger a fu |
  | ll rebuild.
                                                                                         |
  | To set JAVA_HOME: (using bash)
                                                                      |
  | echo "export JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.bash_profile
                                |
  | or `~/.zshrc` if using zsh.
                                                                         |
  |                                                                                                      |
  ========================================================================================================

image

My Application.zip

runningcode commented 3 years ago

Do these instructions on setting java_home work on windows? https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html

AndroidDeveloperLB commented 3 years ago

@runningcode Seems to work after a restart of the OS. Please update the plugin to provide this important information. It can detect that it's Windows OS, right?

Also, I've found that it offers this tip now:

A problem occurred configuring root project 'My Application'.
> =============================== Gradle Doctor Prescriptions ============================================
  | For faster builds, use the parallel GC.                                                              |
  | Add -XX:+UseParallelGC to the org.gradle.jvmargs                                                     |
  ========================================================================================================

But it doesn't say where is this file and how to reach it.

Before, it also told me to reach the project-structure to change it to use JDK, but shouldn't it be global, for all projects? After all, this might not be the same for other people who use the project (might have different path, or even on different OS)... Or it doesn't affect them?