Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest build seems to require Java 8 #805

Closed
nmittler opened this issue Aug 13, 2015 · 3 comments
Closed

Latest build seems to require Java 8 #805

nmittler opened this issue Aug 13, 2015 · 3 comments
Assignees

Comments

@nmittler
Copy link
Member

When building the latest from master, I see an error in the stacktrace indicating that it's looking for Java 8 classes:

Caused by: org.gradle.api.GradleException: Could not generate a proxy class for class com.google.protobuf.gradle.ProtobufSourceDirectorySet.
    at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:204)
    at org.gradle.api.internal.AbstractClassGenerator.generate(AbstractClassGenerator.java:67)
    at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
    at org.gradle.api.internal.plugins.DefaultConvention.create(DefaultConvention.java:106)
    at com.google.protobuf.gradle.ProtobufPlugin$_addSourceSetExtensions_closure4.doCall(ProtobufPlugin.groovy:124)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
    at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:110)
    at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:115)
    at org.gradle.api.DomainObjectCollection$all$1.call(Unknown Source)
    at com.google.protobuf.gradle.ProtobufPlugin.addSourceSetExtensions(ProtobufPlugin.groovy:123)
    at com.google.protobuf.gradle.ProtobufPlugin.apply(ProtobufPlugin.groovy:82)
    at com.google.protobuf.gradle.ProtobufPlugin.apply(ProtobufPlugin.groovy)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
    at org.gradle.api.internal.plugins.RulesCapablePluginApplicator.applyImperative(RulesCapablePluginApplicator.java:42)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:133)
    ... 59 more
Caused by: java.lang.NoClassDefFoundError: java/util/Spliterator
    at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:265)
    at org.gradle.api.internal.AbstractClassGenerator.inspectType(AbstractClassGenerator.java:220)
    at org.gradle.api.internal.AbstractClassGenerator.generateUnderLock(AbstractClassGenerator.java:98)
    ... 73 more
@ejona86
Copy link
Member

ejona86 commented Aug 13, 2015

Could you share the full stack trace?

@zhangkun83
Copy link
Contributor

I can reproduce it with JDK7. The problem is that protobuf-gradle-plugin 0.6.1 requires JDK8 to run. The protobuf-gradle-plugin artifact was built on JDK8, but the build file has targetCompatibility = 1.6 in it. While I don't know why, building it on JDK7 seems to resolve the problem. I will make a 0.6.2 release under JDK7.

zhangkun83 added a commit to google/protobuf-gradle-plugin that referenced this issue Aug 13, 2015
If artifacts are compiled under Java 1.8, they wil require Java 1.8 to
run. See grpc/grpc-java#805
@ejona86
Copy link
Member

ejona86 commented Aug 13, 2015

targetCompatibility only guarantees bytecode compatibility. It won't prevent/find something like using classes or methods that weren't previously supported. That's what we use animal sniffer for.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants