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

Switch to Java 9 for compiling Rhino, while generating Java 8 compatible bytecode #1075

Closed
p-bakker opened this issue Oct 22, 2021 · 3 comments
Labels
enhancement Java Compatibility Issues related to Rhino being compatible to (new) Java releases

Comments

@p-bakker
Copy link
Collaborator

As mentioned by @gbrail in for example #1040 (comment)

@p-bakker p-bakker changed the title Switch to Java 9 for building Rhino, while generating Java 8 bytecode Switch to Java 9 for compiling Rhino, while generating Java 8 compatible bytecode Oct 22, 2021
@p-bakker p-bakker added this to the Release 1.7.15 milestone Oct 22, 2021
@carlosame
Copy link
Contributor

This project is providing the org.mozilla.javascript.engine.RhinoScriptEngineFactory class as a javax.script.ScriptEngineFactory discoverable service (via META-INF/services). If the migration to Java 9+ has to be correct, that implies a full modularisation including a module-info.java file, which is where service providers are advertised now.

In that case, just requiring a compilation with Java 11 but targeting Java 8 bytecode would not work: one needs either a split compilation or Gradle toolchains.

Both approaches introduce complexities, the first one effectively kills incremental compilations (although that could be avoided by adding more complexity) and the second may end installing one or two JDKs into the .gradle home directory (JDKs that you may have already installed). There are implications for importing into IDEs as well.

In any case, the build would become more complex and the source layout must be modified. I'm 100% favourable to this but it would be a large and important change.

@p-bakker
Copy link
Collaborator Author

Also see this note: #1149 (comment)

@p-bakker p-bakker added the Java Compatibility Issues related to Rhino being compatible to (new) Java releases label May 9, 2022
@p-bakker p-bakker removed this from the Release 1.7.15 milestone Nov 16, 2023
@p-bakker
Copy link
Collaborator Author

As of today, with the merge of #1479, the minimum for Rhino is Java 11

@p-bakker p-bakker closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Java Compatibility Issues related to Rhino being compatible to (new) Java releases
Projects
None yet
Development

No branches or pull requests

2 participants