IntelliJ IDEA Gradle sync: Problem with setting Gradle's Java home to some JDKs












2















I have no problem with:




  1. org.gradle.java.home=C:/Program Files/Java/openjdk1.8.0_202


in my (global) gradle.properties file. Also, no problem without it (with nothing set). But if replace it with one of below configurations (all paths are valid):




  1. org.gradle.java.home=C:/Program Files/Java/openjdk-9.0.4

  2. org.gradle.java.home=C:/Program Files/Java/openjdk-10.0.1

  3. org.gradle.java.home=C:/Program Files/Java/openjdk-11.0.1

  4. org.gradle.java.home=C:\Program Files\Java\oraclejdk-11.0.1


then I will get an error message (same for each) after I save the file and import Gradle changes in IntelliJ IDEA:




Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/5.0/userguide/gradle_daemon.html



Please read the following process output to find out more:



OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error: Could not find or load main class java.base.java.lang=ALL-UNNAMED
Caused by: java.lang.ClassNotFoundException: java.base.java.lang=ALL-UNNAMED






The note is the issue is only for IDE Gradle sync. Gradle tasks themselves work correctly (independent from IDE)! Even when I run gradle --status (see here about it) can see everything is OK and daemon is running using JDK 11:



>gradlew --status
PID STATUS INFO
10668 IDLE 5.0


And the path of PID: 10668:



>wmic process where "processId=10668" get Name, ProcessID, ExecutablePath
ExecutablePath Name ProcessId
C:Program FilesJavaopenjdk-11.0.1binjava.exe java.exe 10668









share|improve this question




















  • 1





    Few doubts - Is that a plugin that you're talking about here? - Did you update any configurations other than your .gradle update as mentioned in the question. Few other checks 1. IntelliJ up to date? 2. main class java.base.java.lang=ALL-UNNAMED, I believe you've specified either exports or opens which is what is not recognized. Maybe clearing the doubts would help know where exactly the issue is. Make sure to use compatible versions and update the question with details. On other hand, try using org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m instead of MaxPermSize

    – nullpointer
    Dec 31 '18 at 18:12






  • 1





    @nullpointer - Thanks. After hours of researches for replying your questions, I found the answer! The problem was from my IDE configuration. I realized If I have a fresh installation of IntelliJ IDEA or just removing its configuration directory then the problem will be solved. After a lot of exporting-and-importing my old settings, I found out the issue was from SDK Table.

    – Mir-Ismaili
    Jan 5 at 3:37








  • 1





    Keep trying out things. (thumbs up), go ahead and answer the question with details if that could help someone in the future.

    – nullpointer
    Jan 5 at 3:39













  • @nullpointer - But I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.

    – Mir-Ismaili
    Jan 5 at 3:41













  • @nullpointer. OK, I will post an answer. Thank you.

    – Mir-Ismaili
    Jan 5 at 3:41
















2















I have no problem with:




  1. org.gradle.java.home=C:/Program Files/Java/openjdk1.8.0_202


in my (global) gradle.properties file. Also, no problem without it (with nothing set). But if replace it with one of below configurations (all paths are valid):




  1. org.gradle.java.home=C:/Program Files/Java/openjdk-9.0.4

  2. org.gradle.java.home=C:/Program Files/Java/openjdk-10.0.1

  3. org.gradle.java.home=C:/Program Files/Java/openjdk-11.0.1

  4. org.gradle.java.home=C:\Program Files\Java\oraclejdk-11.0.1


then I will get an error message (same for each) after I save the file and import Gradle changes in IntelliJ IDEA:




Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/5.0/userguide/gradle_daemon.html



Please read the following process output to find out more:



OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error: Could not find or load main class java.base.java.lang=ALL-UNNAMED
Caused by: java.lang.ClassNotFoundException: java.base.java.lang=ALL-UNNAMED






The note is the issue is only for IDE Gradle sync. Gradle tasks themselves work correctly (independent from IDE)! Even when I run gradle --status (see here about it) can see everything is OK and daemon is running using JDK 11:



>gradlew --status
PID STATUS INFO
10668 IDLE 5.0


And the path of PID: 10668:



>wmic process where "processId=10668" get Name, ProcessID, ExecutablePath
ExecutablePath Name ProcessId
C:Program FilesJavaopenjdk-11.0.1binjava.exe java.exe 10668









share|improve this question




















  • 1





    Few doubts - Is that a plugin that you're talking about here? - Did you update any configurations other than your .gradle update as mentioned in the question. Few other checks 1. IntelliJ up to date? 2. main class java.base.java.lang=ALL-UNNAMED, I believe you've specified either exports or opens which is what is not recognized. Maybe clearing the doubts would help know where exactly the issue is. Make sure to use compatible versions and update the question with details. On other hand, try using org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m instead of MaxPermSize

    – nullpointer
    Dec 31 '18 at 18:12






  • 1





    @nullpointer - Thanks. After hours of researches for replying your questions, I found the answer! The problem was from my IDE configuration. I realized If I have a fresh installation of IntelliJ IDEA or just removing its configuration directory then the problem will be solved. After a lot of exporting-and-importing my old settings, I found out the issue was from SDK Table.

    – Mir-Ismaili
    Jan 5 at 3:37








  • 1





    Keep trying out things. (thumbs up), go ahead and answer the question with details if that could help someone in the future.

    – nullpointer
    Jan 5 at 3:39













  • @nullpointer - But I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.

    – Mir-Ismaili
    Jan 5 at 3:41













  • @nullpointer. OK, I will post an answer. Thank you.

    – Mir-Ismaili
    Jan 5 at 3:41














2












2








2








I have no problem with:




  1. org.gradle.java.home=C:/Program Files/Java/openjdk1.8.0_202


in my (global) gradle.properties file. Also, no problem without it (with nothing set). But if replace it with one of below configurations (all paths are valid):




  1. org.gradle.java.home=C:/Program Files/Java/openjdk-9.0.4

  2. org.gradle.java.home=C:/Program Files/Java/openjdk-10.0.1

  3. org.gradle.java.home=C:/Program Files/Java/openjdk-11.0.1

  4. org.gradle.java.home=C:\Program Files\Java\oraclejdk-11.0.1


then I will get an error message (same for each) after I save the file and import Gradle changes in IntelliJ IDEA:




Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/5.0/userguide/gradle_daemon.html



Please read the following process output to find out more:



OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error: Could not find or load main class java.base.java.lang=ALL-UNNAMED
Caused by: java.lang.ClassNotFoundException: java.base.java.lang=ALL-UNNAMED






The note is the issue is only for IDE Gradle sync. Gradle tasks themselves work correctly (independent from IDE)! Even when I run gradle --status (see here about it) can see everything is OK and daemon is running using JDK 11:



>gradlew --status
PID STATUS INFO
10668 IDLE 5.0


And the path of PID: 10668:



>wmic process where "processId=10668" get Name, ProcessID, ExecutablePath
ExecutablePath Name ProcessId
C:Program FilesJavaopenjdk-11.0.1binjava.exe java.exe 10668









share|improve this question
















I have no problem with:




  1. org.gradle.java.home=C:/Program Files/Java/openjdk1.8.0_202


in my (global) gradle.properties file. Also, no problem without it (with nothing set). But if replace it with one of below configurations (all paths are valid):




  1. org.gradle.java.home=C:/Program Files/Java/openjdk-9.0.4

  2. org.gradle.java.home=C:/Program Files/Java/openjdk-10.0.1

  3. org.gradle.java.home=C:/Program Files/Java/openjdk-11.0.1

  4. org.gradle.java.home=C:\Program Files\Java\oraclejdk-11.0.1


then I will get an error message (same for each) after I save the file and import Gradle changes in IntelliJ IDEA:




Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/5.0/userguide/gradle_daemon.html



Please read the following process output to find out more:



OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Error: Could not find or load main class java.base.java.lang=ALL-UNNAMED
Caused by: java.lang.ClassNotFoundException: java.base.java.lang=ALL-UNNAMED






The note is the issue is only for IDE Gradle sync. Gradle tasks themselves work correctly (independent from IDE)! Even when I run gradle --status (see here about it) can see everything is OK and daemon is running using JDK 11:



>gradlew --status
PID STATUS INFO
10668 IDLE 5.0


And the path of PID: 10668:



>wmic process where "processId=10668" get Name, ProcessID, ExecutablePath
ExecutablePath Name ProcessId
C:Program FilesJavaopenjdk-11.0.1binjava.exe java.exe 10668






java gradle intellij-idea






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 5 at 4:02







Mir-Ismaili

















asked Dec 31 '18 at 16:55









Mir-IsmailiMir-Ismaili

2,2151438




2,2151438








  • 1





    Few doubts - Is that a plugin that you're talking about here? - Did you update any configurations other than your .gradle update as mentioned in the question. Few other checks 1. IntelliJ up to date? 2. main class java.base.java.lang=ALL-UNNAMED, I believe you've specified either exports or opens which is what is not recognized. Maybe clearing the doubts would help know where exactly the issue is. Make sure to use compatible versions and update the question with details. On other hand, try using org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m instead of MaxPermSize

    – nullpointer
    Dec 31 '18 at 18:12






  • 1





    @nullpointer - Thanks. After hours of researches for replying your questions, I found the answer! The problem was from my IDE configuration. I realized If I have a fresh installation of IntelliJ IDEA or just removing its configuration directory then the problem will be solved. After a lot of exporting-and-importing my old settings, I found out the issue was from SDK Table.

    – Mir-Ismaili
    Jan 5 at 3:37








  • 1





    Keep trying out things. (thumbs up), go ahead and answer the question with details if that could help someone in the future.

    – nullpointer
    Jan 5 at 3:39













  • @nullpointer - But I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.

    – Mir-Ismaili
    Jan 5 at 3:41













  • @nullpointer. OK, I will post an answer. Thank you.

    – Mir-Ismaili
    Jan 5 at 3:41














  • 1





    Few doubts - Is that a plugin that you're talking about here? - Did you update any configurations other than your .gradle update as mentioned in the question. Few other checks 1. IntelliJ up to date? 2. main class java.base.java.lang=ALL-UNNAMED, I believe you've specified either exports or opens which is what is not recognized. Maybe clearing the doubts would help know where exactly the issue is. Make sure to use compatible versions and update the question with details. On other hand, try using org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m instead of MaxPermSize

    – nullpointer
    Dec 31 '18 at 18:12






  • 1





    @nullpointer - Thanks. After hours of researches for replying your questions, I found the answer! The problem was from my IDE configuration. I realized If I have a fresh installation of IntelliJ IDEA or just removing its configuration directory then the problem will be solved. After a lot of exporting-and-importing my old settings, I found out the issue was from SDK Table.

    – Mir-Ismaili
    Jan 5 at 3:37








  • 1





    Keep trying out things. (thumbs up), go ahead and answer the question with details if that could help someone in the future.

    – nullpointer
    Jan 5 at 3:39













  • @nullpointer - But I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.

    – Mir-Ismaili
    Jan 5 at 3:41













  • @nullpointer. OK, I will post an answer. Thank you.

    – Mir-Ismaili
    Jan 5 at 3:41








1




1





Few doubts - Is that a plugin that you're talking about here? - Did you update any configurations other than your .gradle update as mentioned in the question. Few other checks 1. IntelliJ up to date? 2. main class java.base.java.lang=ALL-UNNAMED, I believe you've specified either exports or opens which is what is not recognized. Maybe clearing the doubts would help know where exactly the issue is. Make sure to use compatible versions and update the question with details. On other hand, try using org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m instead of MaxPermSize

– nullpointer
Dec 31 '18 at 18:12





Few doubts - Is that a plugin that you're talking about here? - Did you update any configurations other than your .gradle update as mentioned in the question. Few other checks 1. IntelliJ up to date? 2. main class java.base.java.lang=ALL-UNNAMED, I believe you've specified either exports or opens which is what is not recognized. Maybe clearing the doubts would help know where exactly the issue is. Make sure to use compatible versions and update the question with details. On other hand, try using org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m instead of MaxPermSize

– nullpointer
Dec 31 '18 at 18:12




1




1





@nullpointer - Thanks. After hours of researches for replying your questions, I found the answer! The problem was from my IDE configuration. I realized If I have a fresh installation of IntelliJ IDEA or just removing its configuration directory then the problem will be solved. After a lot of exporting-and-importing my old settings, I found out the issue was from SDK Table.

– Mir-Ismaili
Jan 5 at 3:37







@nullpointer - Thanks. After hours of researches for replying your questions, I found the answer! The problem was from my IDE configuration. I realized If I have a fresh installation of IntelliJ IDEA or just removing its configuration directory then the problem will be solved. After a lot of exporting-and-importing my old settings, I found out the issue was from SDK Table.

– Mir-Ismaili
Jan 5 at 3:37






1




1





Keep trying out things. (thumbs up), go ahead and answer the question with details if that could help someone in the future.

– nullpointer
Jan 5 at 3:39







Keep trying out things. (thumbs up), go ahead and answer the question with details if that could help someone in the future.

– nullpointer
Jan 5 at 3:39















@nullpointer - But I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.

– Mir-Ismaili
Jan 5 at 3:41







@nullpointer - But I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.

– Mir-Ismaili
Jan 5 at 3:41















@nullpointer. OK, I will post an answer. Thank you.

– Mir-Ismaili
Jan 5 at 3:41





@nullpointer. OK, I will post an answer. Thank you.

– Mir-Ismaili
Jan 5 at 3:41












1 Answer
1






active

oldest

votes


















2














Finally, I found out the issue was from my IDE settings. It was from SDK Table.



I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.





Note: You don't need a fresh installation really. Just enough to close your IDE, rename its configuration directory and re-open it.



Then IDE starts freshly. So is a fortune for the test. If there wasn't the issue export pointed setting ... File -> Export Settings ...:



enter image description here



to a file. Then return to your previous state and import the exported file:



enter image description here



If the issue reverted you need to check other settings (other than SDK Table).






share|improve this answer


























  • In my case SDK import/export did not help really, however just removing gradle.properties file from the .gradle folder in the user home solved the initial error. Really weird bug... Many thanks for posting this!

    – Dime
    Jan 17 at 12:47











  • @Dime. You're welcome. Doesn't removing gradle.properties cause removing org.gradle.java.home? If so the issue has been cleared. If not, I suggest posting the solution as an answer. It may help others.

    – Mir-Ismaili
    Jan 18 at 17:55













  • Yes, when gradle.properties is gone, gradle.java.home property is also no longer set. But, as there are other ways of setting gradle.java.home, it is acceptable in my setup. Still wondering why this properties affects IntelliJ Gradle integration in such a weird way :) My initial question: stackoverflow.com/questions/54221693/…

    – Dime
    Jan 21 at 8:22













  • @Dime. Is the problem still there after a fresh installation of IntelliJ IDEA? I. e. after removing (moving) its configuration directory? I want to know the issue is from the application itself or from its data ...

    – Mir-Ismaili
    Jan 21 at 13:28













  • Yes. In my case, re-installation of IntelliJ or empty configuration folders did not help at all. Also re-import of fresh SDK Tables, as you have suggested. No idea why. As soon as gradle.properties is back, the build in IntelliJ does not work anymore. And it does not work only in IntelliJ and only in case of Java 11 and Gradle 5.x (specified in the wrapper). Gradle 4.x works just fine with Java 11 and IntelliJ...

    – Dime
    Jan 21 at 16:26











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%2f53989697%2fintellij-idea-gradle-sync-problem-with-setting-gradles-java-home-to-some-jdks%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Finally, I found out the issue was from my IDE settings. It was from SDK Table.



I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.





Note: You don't need a fresh installation really. Just enough to close your IDE, rename its configuration directory and re-open it.



Then IDE starts freshly. So is a fortune for the test. If there wasn't the issue export pointed setting ... File -> Export Settings ...:



enter image description here



to a file. Then return to your previous state and import the exported file:



enter image description here



If the issue reverted you need to check other settings (other than SDK Table).






share|improve this answer


























  • In my case SDK import/export did not help really, however just removing gradle.properties file from the .gradle folder in the user home solved the initial error. Really weird bug... Many thanks for posting this!

    – Dime
    Jan 17 at 12:47











  • @Dime. You're welcome. Doesn't removing gradle.properties cause removing org.gradle.java.home? If so the issue has been cleared. If not, I suggest posting the solution as an answer. It may help others.

    – Mir-Ismaili
    Jan 18 at 17:55













  • Yes, when gradle.properties is gone, gradle.java.home property is also no longer set. But, as there are other ways of setting gradle.java.home, it is acceptable in my setup. Still wondering why this properties affects IntelliJ Gradle integration in such a weird way :) My initial question: stackoverflow.com/questions/54221693/…

    – Dime
    Jan 21 at 8:22













  • @Dime. Is the problem still there after a fresh installation of IntelliJ IDEA? I. e. after removing (moving) its configuration directory? I want to know the issue is from the application itself or from its data ...

    – Mir-Ismaili
    Jan 21 at 13:28













  • Yes. In my case, re-installation of IntelliJ or empty configuration folders did not help at all. Also re-import of fresh SDK Tables, as you have suggested. No idea why. As soon as gradle.properties is back, the build in IntelliJ does not work anymore. And it does not work only in IntelliJ and only in case of Java 11 and Gradle 5.x (specified in the wrapper). Gradle 4.x works just fine with Java 11 and IntelliJ...

    – Dime
    Jan 21 at 16:26
















2














Finally, I found out the issue was from my IDE settings. It was from SDK Table.



I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.





Note: You don't need a fresh installation really. Just enough to close your IDE, rename its configuration directory and re-open it.



Then IDE starts freshly. So is a fortune for the test. If there wasn't the issue export pointed setting ... File -> Export Settings ...:



enter image description here



to a file. Then return to your previous state and import the exported file:



enter image description here



If the issue reverted you need to check other settings (other than SDK Table).






share|improve this answer


























  • In my case SDK import/export did not help really, however just removing gradle.properties file from the .gradle folder in the user home solved the initial error. Really weird bug... Many thanks for posting this!

    – Dime
    Jan 17 at 12:47











  • @Dime. You're welcome. Doesn't removing gradle.properties cause removing org.gradle.java.home? If so the issue has been cleared. If not, I suggest posting the solution as an answer. It may help others.

    – Mir-Ismaili
    Jan 18 at 17:55













  • Yes, when gradle.properties is gone, gradle.java.home property is also no longer set. But, as there are other ways of setting gradle.java.home, it is acceptable in my setup. Still wondering why this properties affects IntelliJ Gradle integration in such a weird way :) My initial question: stackoverflow.com/questions/54221693/…

    – Dime
    Jan 21 at 8:22













  • @Dime. Is the problem still there after a fresh installation of IntelliJ IDEA? I. e. after removing (moving) its configuration directory? I want to know the issue is from the application itself or from its data ...

    – Mir-Ismaili
    Jan 21 at 13:28













  • Yes. In my case, re-installation of IntelliJ or empty configuration folders did not help at all. Also re-import of fresh SDK Tables, as you have suggested. No idea why. As soon as gradle.properties is back, the build in IntelliJ does not work anymore. And it does not work only in IntelliJ and only in case of Java 11 and Gradle 5.x (specified in the wrapper). Gradle 4.x works just fine with Java 11 and IntelliJ...

    – Dime
    Jan 21 at 16:26














2












2








2







Finally, I found out the issue was from my IDE settings. It was from SDK Table.



I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.





Note: You don't need a fresh installation really. Just enough to close your IDE, rename its configuration directory and re-open it.



Then IDE starts freshly. So is a fortune for the test. If there wasn't the issue export pointed setting ... File -> Export Settings ...:



enter image description here



to a file. Then return to your previous state and import the exported file:



enter image description here



If the issue reverted you need to check other settings (other than SDK Table).






share|improve this answer















Finally, I found out the issue was from my IDE settings. It was from SDK Table.



I don't know why correcting them from Project Structure (or Structure for new Projects in Other Settings) couldn't solve the issue. Finally, I imported it (and only it) from a fresh installation.





Note: You don't need a fresh installation really. Just enough to close your IDE, rename its configuration directory and re-open it.



Then IDE starts freshly. So is a fortune for the test. If there wasn't the issue export pointed setting ... File -> Export Settings ...:



enter image description here



to a file. Then return to your previous state and import the exported file:



enter image description here



If the issue reverted you need to check other settings (other than SDK Table).







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 21 at 13:37

























answered Jan 5 at 3:57









Mir-IsmailiMir-Ismaili

2,2151438




2,2151438













  • In my case SDK import/export did not help really, however just removing gradle.properties file from the .gradle folder in the user home solved the initial error. Really weird bug... Many thanks for posting this!

    – Dime
    Jan 17 at 12:47











  • @Dime. You're welcome. Doesn't removing gradle.properties cause removing org.gradle.java.home? If so the issue has been cleared. If not, I suggest posting the solution as an answer. It may help others.

    – Mir-Ismaili
    Jan 18 at 17:55













  • Yes, when gradle.properties is gone, gradle.java.home property is also no longer set. But, as there are other ways of setting gradle.java.home, it is acceptable in my setup. Still wondering why this properties affects IntelliJ Gradle integration in such a weird way :) My initial question: stackoverflow.com/questions/54221693/…

    – Dime
    Jan 21 at 8:22













  • @Dime. Is the problem still there after a fresh installation of IntelliJ IDEA? I. e. after removing (moving) its configuration directory? I want to know the issue is from the application itself or from its data ...

    – Mir-Ismaili
    Jan 21 at 13:28













  • Yes. In my case, re-installation of IntelliJ or empty configuration folders did not help at all. Also re-import of fresh SDK Tables, as you have suggested. No idea why. As soon as gradle.properties is back, the build in IntelliJ does not work anymore. And it does not work only in IntelliJ and only in case of Java 11 and Gradle 5.x (specified in the wrapper). Gradle 4.x works just fine with Java 11 and IntelliJ...

    – Dime
    Jan 21 at 16:26



















  • In my case SDK import/export did not help really, however just removing gradle.properties file from the .gradle folder in the user home solved the initial error. Really weird bug... Many thanks for posting this!

    – Dime
    Jan 17 at 12:47











  • @Dime. You're welcome. Doesn't removing gradle.properties cause removing org.gradle.java.home? If so the issue has been cleared. If not, I suggest posting the solution as an answer. It may help others.

    – Mir-Ismaili
    Jan 18 at 17:55













  • Yes, when gradle.properties is gone, gradle.java.home property is also no longer set. But, as there are other ways of setting gradle.java.home, it is acceptable in my setup. Still wondering why this properties affects IntelliJ Gradle integration in such a weird way :) My initial question: stackoverflow.com/questions/54221693/…

    – Dime
    Jan 21 at 8:22













  • @Dime. Is the problem still there after a fresh installation of IntelliJ IDEA? I. e. after removing (moving) its configuration directory? I want to know the issue is from the application itself or from its data ...

    – Mir-Ismaili
    Jan 21 at 13:28













  • Yes. In my case, re-installation of IntelliJ or empty configuration folders did not help at all. Also re-import of fresh SDK Tables, as you have suggested. No idea why. As soon as gradle.properties is back, the build in IntelliJ does not work anymore. And it does not work only in IntelliJ and only in case of Java 11 and Gradle 5.x (specified in the wrapper). Gradle 4.x works just fine with Java 11 and IntelliJ...

    – Dime
    Jan 21 at 16:26

















In my case SDK import/export did not help really, however just removing gradle.properties file from the .gradle folder in the user home solved the initial error. Really weird bug... Many thanks for posting this!

– Dime
Jan 17 at 12:47





In my case SDK import/export did not help really, however just removing gradle.properties file from the .gradle folder in the user home solved the initial error. Really weird bug... Many thanks for posting this!

– Dime
Jan 17 at 12:47













@Dime. You're welcome. Doesn't removing gradle.properties cause removing org.gradle.java.home? If so the issue has been cleared. If not, I suggest posting the solution as an answer. It may help others.

– Mir-Ismaili
Jan 18 at 17:55







@Dime. You're welcome. Doesn't removing gradle.properties cause removing org.gradle.java.home? If so the issue has been cleared. If not, I suggest posting the solution as an answer. It may help others.

– Mir-Ismaili
Jan 18 at 17:55















Yes, when gradle.properties is gone, gradle.java.home property is also no longer set. But, as there are other ways of setting gradle.java.home, it is acceptable in my setup. Still wondering why this properties affects IntelliJ Gradle integration in such a weird way :) My initial question: stackoverflow.com/questions/54221693/…

– Dime
Jan 21 at 8:22







Yes, when gradle.properties is gone, gradle.java.home property is also no longer set. But, as there are other ways of setting gradle.java.home, it is acceptable in my setup. Still wondering why this properties affects IntelliJ Gradle integration in such a weird way :) My initial question: stackoverflow.com/questions/54221693/…

– Dime
Jan 21 at 8:22















@Dime. Is the problem still there after a fresh installation of IntelliJ IDEA? I. e. after removing (moving) its configuration directory? I want to know the issue is from the application itself or from its data ...

– Mir-Ismaili
Jan 21 at 13:28







@Dime. Is the problem still there after a fresh installation of IntelliJ IDEA? I. e. after removing (moving) its configuration directory? I want to know the issue is from the application itself or from its data ...

– Mir-Ismaili
Jan 21 at 13:28















Yes. In my case, re-installation of IntelliJ or empty configuration folders did not help at all. Also re-import of fresh SDK Tables, as you have suggested. No idea why. As soon as gradle.properties is back, the build in IntelliJ does not work anymore. And it does not work only in IntelliJ and only in case of Java 11 and Gradle 5.x (specified in the wrapper). Gradle 4.x works just fine with Java 11 and IntelliJ...

– Dime
Jan 21 at 16:26





Yes. In my case, re-installation of IntelliJ or empty configuration folders did not help at all. Also re-import of fresh SDK Tables, as you have suggested. No idea why. As soon as gradle.properties is back, the build in IntelliJ does not work anymore. And it does not work only in IntelliJ and only in case of Java 11 and Gradle 5.x (specified in the wrapper). Gradle 4.x works just fine with Java 11 and IntelliJ...

– Dime
Jan 21 at 16:26




















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%2f53989697%2fintellij-idea-gradle-sync-problem-with-setting-gradles-java-home-to-some-jdks%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

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas