[GRADLE-3094] Scala plugin doesn't work when Gradle is run with Java 8 Created: 27/May/14 Updated: 04/Jun/14 Resolved: 30/May/14 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.12 |
Fix Version/s: | 2.0-rc-1 |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Peter Niederwieser |
Resolution: | Fixed | Votes: | 1 |
Description |
Hi, I'm using sala 1.10 and I'm unable to setup a scala build thanks to the scala plugin. I'm a newbie with gradle. Can someone help me ? Thanks |
Comments |
Comment by Gradle Forums [ 27/May/14 ] |
Can you provide a reproducible example? Meanwhile, you can study the Scala chapter in the [Gradle User Guide]([1]http://gradle.org/docs/current/usergu...), check out the Scala sample builds in the full Gradle distribution, or use `gradle init --type scala-library` to create a working skeleton for a Scala build. |
Comment by Gradle Forums [ 27/May/14 ] |
Same error when I run : $ gradle init --type scala-library Please see the stacktrace in the [gist]([1]https://gist.github.com/pjean/8469878) |
Comment by Gradle Forums [ 27/May/14 ] |
I can't reproduce this, and I wonder if it's at all related to Gradle's Scala support. (Can you verify this?) My best guess is that your JDK installation isn't clean (e.g. you have some libs in `jre/lib`) or your Gradle installation is corrupted. Can you show the output of `gradle -v`? |
Comment by Gradle Forums [ 27/May/14 ] |
------------------------------------------------------------ Build time: 2013-12-17 09:28:15 UTC Groovy: 1.8.6 |
Comment by Gradle Forums [ 27/May/14 ] |
Perhaps your Scala version isn't compatible with Java 1.8 (I'm not sure if any released Scala version is). Can you try if running Gradle with JDK 1.7 solves the problem? If this also happens when using, say, the Java plugin, rather than the Scala plugin, then it might be a problem with Gradle and Java 8, and a reproducible example would be appreciated. |
Comment by Gradle Forums [ 27/May/14 ] |
I set up my JAVA_HOME to use 1.7 and it works fine. Thanks for your help UPDATE : Gradle and Java plugin works fine with Java 8 |
Comment by Gradle Forums [ 27/May/14 ] |
This may be a bug in Java 8. getPropertyType() allows for returning null and it is called in the parameter list of isAssignableFrom(), which does not allow for nulls. Relevent code: if (isAssignable(gpd.getPropertyType() /* Can return null /, pd.getPropertyType() / Can return null */)) { Relevent breaking patch to the JDK: [1]http://hg.openjdk.java.net/hsx/hotspo... |
Comment by Gradle Forums [ 27/May/14 ] |
------------------------------------------------------------ Build time: 2013-12-17 09:28:15 UTC Groovy: 1.8.6 |
Comment by Gradle Forums [ 27/May/14 ] |
generates an exception : Could not create task of type 'ScalaDoc' |
Comment by Gradle Forums [ 27/May/14 ] |
bug in Gradle |
Comment by Gradle Forums [ 27/May/14 ] |
I get the same error with Gradle 1.10 and the latest Java 8 RC. I don't get the error with Java 7. And I don't have any issues with running Scala itself on Java 8 RC. So it seems like Gradle 1.10 (or the Scala plugin of Gradle 1.10) is incompatible with the latest Java 8 RC. java version "1.8.0" ------------------------------------------------------------ Build time: 2013-12-17 09:28:15 UTC Groovy: 1.8.6 java.lang.NullPointerException |
Comment by Gradle Forums [ 27/May/14 ] |
goodbye gradle... |
Comment by Gradle Forums [ 27/May/14 ] |
Well I had to downgrade to Java 7. Basically my fault to use a beta software but I hope gradle to fix this shortly. |
Comment by Gradle Forums [ 27/May/14 ] |
I have the same issue with java version "1.8.0_05", scala-2.10.3 and gradle-1.11 |
Comment by Gradle Forums [ 27/May/14 ] |
Issue is still there, gradle-1.12, scala 2.10.4, jdk 1.8.0_05 |
Comment by Gradle Forums [ 27/May/14 ] |
Try with 2.0 nightly. 2.0 will be the first Gradle version that officially supports to be run with Java 8. |
Comment by Gradle Forums [ 27/May/14 ] |
Just tried both 2.0 and 2.1 snapshots (gradle-2.0-20140515233139+0000 and gradle-2.1-20140526220021+0000) - neither worked. |
Comment by Gradle Forums [ 27/May/14 ] |
Thanks. We'll try to fix it for 2.0. |
Comment by Peter Niederwieser [ 30/May/14 ] |
Comment by Roman Janusz [ 30/May/14 ] |
https://groups.google.com/forum/#!topic/scala-user/tEJwYHW4Txc |
Comment by Jason Zaugg [ 30/May/14 ] |
Both Scala 2.10.4 and 2.11.1 should both work with JDK8. What issues are you seeing? |
Comment by Peter Niederwieser [ 30/May/14 ] |
Thanks for the notice. Executing our Scala compiler acceptance tests in IntelliJ produced some constant pool error in the Scala compile task. The error went away after a full IntelliJ rebuild, and I don't have the details anymore. Will have to investigate if the Scala compile task also works when Gradle itself gets compiled with JDK6 rather than JDK8. |
Comment by Elliot [ 30/May/14 ] |
This ticket has a fix version of 2.x. Can you also fix this in 1.x? |
Comment by Peter Niederwieser [ 30/May/14 ] |
1.12 was the last 1.x release. 2.0 will follow soon. |
Comment by Bernie Schelberg [ 31/May/14 ] |
@Elliot, there are some patched versions specified in |