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

[BUG] JDK8-incompatible bytecode when compiled with JDK 11 #4649

Closed
gerashegalov opened this issue Jan 27, 2022 · 0 comments · Fixed by #5528
Closed

[BUG] JDK8-incompatible bytecode when compiled with JDK 11 #4649

gerashegalov opened this issue Jan 27, 2022 · 0 comments · Fixed by #5528
Labels
build Related to CI / CD or cleanly building

Comments

@gerashegalov
Copy link
Collaborator

gerashegalov commented Jan 27, 2022

Describe the bug
Despite the fact that our build is attempting to enforce JDK 8 as its target via maven.compiler.source/target=1.8, when the user builds using JDK 11 the build succeeds but the Plugin fails at run time.

java.lang.NoSuchMethodError: java.nio.ByteBuffer.mark()Ljava/nio/ByteBuffer;
E                       at com.nvidia.spark.rapids.MetaUtils$.buildTableMeta(MetaUtils.scala:112)
E                       at com.nvidia.spark.rapids.MetaUtils$.buildTableMeta(MetaUtils.scala:61)
E                       at com.nvidia.spark.rapids.MetaUtils$.buildTableMeta(MetaUtils.scala:51)

Steps/Code to reproduce bug
Build with JDK 11
and use JAVA_HOME=/path/to/jdk8 spark-shell ... to launch Spark with spark-rapids

Expected behavior
Either

  • Transparently handle this using a special Maven profile and maven.compiler.release. Fail build if user's Maven version does not support it
  • Or fail build if we don't want the users to use later JDK's for building until it's supported.

Environment details (please complete the following information)

  • local dev

Additional context
originally reported by @NVnavkumar

@gerashegalov gerashegalov added bug Something isn't working ? - Needs Triage Need team to review and classify labels Jan 27, 2022
@sameerz sameerz added build Related to CI / CD or cleanly building and removed bug Something isn't working ? - Needs Triage Need team to review and classify labels Feb 1, 2022
gerashegalov added a commit that referenced this issue May 20, 2022
This PR closes #4649, #3682.

- add a doc for JDK9+ property with potential cross-compilation to lower Java major versions
- `allowConventionalDistJar` for conventional jar creation when only one shim is included
- automatically detect conventional jar and suppress warnings about classloader issues 
- remove manual configuration of javac args for scala-maven-plugin.  This plugin processes `maven .compiler.*` and adds the right set of javac opts automatically. 3.4.x we use for db doesn't handle maven.compiler.release, however, we don't need it at the moment and it's currently not used.
- disambiguate calls to buf.position() generating errors on JDK11

Note this PR only builds skipping running tests `-DskipTests` because we still need to address #3851 (comment) 
  
Signed-off-by: Gera Shegalov <gera@apache.org>
@sameerz sameerz modified the milestone: May 23 - Jun 3 May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to CI / CD or cleanly building
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants