Fix Freshmark compatibility with JDK 15+ (fixes #803)#1304
Fix Freshmark compatibility with JDK 15+ (fixes #803)#1304nedtwigg merged 6 commits intodiffplug:mainfrom
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.