Gradle problems using Java 9 onwards due to bug in java Command-Line Argument Files


(Sabre Tooth) #1

Hi,

I noticed Gradle is making use of the new java Command-Line Argument Files which was a feature introduced in Java9.

https://docs.oracle.com/javase/9/tools/java.htm#JSWOR-GUID-4856361B-8BFD-4964-AE84-121F5F6CF111

Unfortunately, due to a bug in this feature, there are not uncommon cases where Gradle builds fail, and do not fail consistently. The JDK bug is reported here: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8208745

Please can you tell me whether there is a flag in gradle that I can set, to avoid using Command-Line Argument Files to pass the classpath to gradle workers?


(Stefan Oehme) #2

There is no switch and I don’t think it would help, because if your classpath is very long (as described in the JDK bug), you would probably get a “command line too long” instead.


(Sabre Tooth) #3

This only became an issue when I migrated my project from Java8 to Java9. The classpath wasn’t too long in Java8 so it should continue to work in Java9 if a switch was made available.


(Stefan Oehme) #4

That’s because we had a hack to keep it short, but that doesn’t work anymore in Java 9.