[GRADLE-3029] Jdk6JavaCompiler.findCompiler() causes concurrency issues by setting "java.home" system property Created: 18/Feb/14 Updated: 10/Dec/15 Resolved: 10/Dec/15 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | 2.11-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 9 |
Attachments: | gradle3029.txt |
Description |
Jdk6JavaCompiler.findCompiler() causes concurrency issues by setting "java.home" system property for resolving Java Compiler. ... httpclient expects cacert to be in System.getProperty("java.home")/lib/security/cacert, but "java.home" is set to JDK-dir temporarily by the method mentioned above. By default, on Oracle JDK, "java.home" is always set to /jre if there is such a directory, even if started with JAVA_HOME= and/or with /bin/java. That means: usually it does find the cacert in the jre/lib folder fine, but if the "findCompiler" method changes "java.home" in that moment, it fails. I am running on Windows 2012 Server with gradle 1.9, but I saw the source is the same in 1.11. ToolProvider.getSystemJavaCompiler(), which is used there, will find the tools.jar correctly without all that logic, at least on windows. |
Comments |
Comment by Gradle Forums [ 18/Feb/14 ] |
Our workaround for now is to set javax.net.ssl.trustStore explicitely to `<JDK_HOME>/jre/lib/security/cacert` and provide javax.net.ssl.trustStorePassword with the default password for cacert. |
Comment by Sebastian Glahn [ 20/Nov/14 ] |
Looks like I also run into this issue: http://forums.gradle.org/gradle/topics/filenotfoundexception-jdk-lib-security-cacerts |
Comment by Chris Mosher [ 29/May/15 ] |
We still seeing this happening under Gradle 2.4. Stack trace attached. |
Comment by Luke Daley [ 31/May/15 ] |
issue not fixed. |
Comment by Alban [ 08/Jul/15 ] |
We're running into this issue too with 2.4. Got a "Failure initializing default system SSL context" message when downloading dependencies when using the --parallel parameter. |
Comment by Luke Daley [ 12/Jul/15 ] |
This is actually blocked on https://issues.gradle.org/browse/GRADLE-3250, which is in progress. |
Comment by Alban [ 08/Dec/15 ] |
Oh, I've been waiting so long for this one! I'll be able to re-parallelize some tasks now. Thank! |