-
Notifications
You must be signed in to change notification settings - Fork 455
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
Fix Freshmark compatibility with JDK 15+ (fixes #803) #1304
Fix Freshmark compatibility with JDK 15+ (fixes #803) #1304
Conversation
273a832
to
225d992
Compare
Hi @nedtwigg, I've implemented the functionality as you've described in #803 , but unfortunately it is not working. The Nashorn library is provided as a JPMS module with a module descriptor file. The service provider infrastructure does not automatically pick up the library's implementation of the script engine. Furthermore, I guess JDK9+ rejects loading the classes from the lib as the --module-path and --add-modules arguments are missing. Some more information: This describes how a possible solution could look like: https://stackoverflow.com/questions/48742354/best-approach-to-dynamically-load-modules-classes-in-java Modifying the module path layer, could work, but I cannot directly access these classes as the library must be compatible with Java 8 compilation. Reflection could be used, but hard to read. |
This is a good answer how to load a JPMS module dynamically: |
Should loading the Nashorn library/module be implemented with reflection or should another small lib be implemented which uses Java9+ and is loaded dynamically into the classpath and then a static method is called to load the Nashorn module? |
Thanks so much for tackling this!
Another possible approach is to look at They are two PR's but should have been one. |
Thanks very much @beegee1 for getting this started! Fixing this required making a silly little change in an upstream project. |
Released in |
No description provided.