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

ClassDefinitionUtils doesn't compile with Java 11 #61

Closed
ebourg opened this issue Oct 3, 2018 · 2 comments
Closed

ClassDefinitionUtils doesn't compile with Java 11 #61

ebourg opened this issue Oct 3, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@ebourg
Copy link

ebourg commented Oct 3, 2018

ClassDefinitionUtils.defineClass() uses the Unsafe.defineClass() method which was removed in Java 11:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project objenesis: Compilation failure
[ERROR] ~/objenesis/main/src/main/java/org/objenesis/instantiator/util/ClassDefinitionUtils.java:[100,54] cannot find symbol
[ERROR]   symbol:   method defineClass(java.lang.String,byte[],int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
[ERROR]   location: class sun.misc.Unsafe
@henri-tremblay
Copy link
Contributor

Thanks. I'm aware of it. Should have filed it. I'm on it right now. If you have a PR for that, I'm listening.

Useful resources are:
https://dzone.com/articles/jdk-11-and-proxies-in-a-world-past-sunmiscunsafe
https://github.com/jboss-javassist/javassist/pull/198/files
https://github.com/gradle/gradle/pull/4976/files

@henri-tremblay henri-tremblay self-assigned this Oct 3, 2018
@henri-tremblay henri-tremblay added this to the 2.7 milestone Oct 3, 2018
@ebourg
Copy link
Author

ebourg commented Oct 7, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants