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

Upgrade to Java 11 #542

Open
perNyfelt opened this issue Jan 22, 2022 · 2 comments
Open

Upgrade to Java 11 #542

perNyfelt opened this issue Jan 22, 2022 · 2 comments

Comments

@perNyfelt
Copy link
Contributor

Premier support of Java 8 ends in March 2022
Non-LTS Java 9 and Java 10 aren't supported since 2018 and the next LTS release is 11 which has Premier support until September 2023. More and more OS libraries are starting to require java 11 so I think it makes sense for us to move there as soon as possible as well.

@perNyfelt
Copy link
Contributor Author

perNyfelt commented Jan 23, 2022

I made an initial attempt here: https://github.com/perNyfelt/renjin/tree/java11

I did NOT do any modularization but tried to stay as close to the current implementation as possible. As a result, not many files needed to change.

Good things: it compiles and all tests pass.

Maybe problematic things:

  1. The Classloader after java 8 is no longer a URLClassloader and the module system makes this non-trivial to adress. To work around that I did:
  • In the gcc-bridge i introduced a dependency on the classgraph project to build a custom URLClassloader with all classpath elements to get Soot to work.
  • In the ForkedTestControllerTest I just changed getCurrentClassPath to do System.getProperty("java.class.path")
  • In test.local.file.R in the test.jar.resource function i changed the test for res:java/util/Map.class to res:org/renjin/sexp/AtomicVector.class. The reason is that res:java/util/Map.class resolves to jrt:///java.base/java/util/Map.class which the FileSystemManager cannot make sense of. There is a way to handle this in later versions of vfs2 but upgrading vf2 looked like a LOT of work. I am not sure of the use case for locating a jar for java internal classes (e.g. java.util.Map) - there really isn't one in the jigsaw world, however if this case is important, it is probably possible to do some magic with the help of ClassGraph.

So at least there is a buildable branch based on java 11. Comments and/or suggestions would be most welcome!

@perNyfelt perNyfelt mentioned this issue Jan 24, 2022
@akbertram
Copy link
Member

This is great, Per!

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

No branches or pull requests

2 participants