reflections
reflections copied to clipboard
Java 9 support and jrt: URLs
I was recently trying to research the effects Java 9 will have on class and resource loading and specifically on libraries like Reflections. Based on the info I got (mostly from Mark Reinhold himself), scanning for classes is still possible and Reflections should still work but he noted that, for completeness, it should also scan jrt: URLs. I won't pretend to understand fully what that entails, but was hoping to start a conversation on Java 9 support in Reflections.
Relevant link to the description: https://stackoverflow.com/questions/45166757/loading-classes-and-resources-in-java-9/45173837#45173837
More references on JRT urls http://openjdk.java.net/jeps/220
Here's an answer with helpful clues: https://stackoverflow.com/a/45612376/294657
Here is a cheatsheet from competing project: https://github.com/lukehutch/fast-classpath-scanner/issues/36
Just to let you know in case anyone is looking on this too, I'm working on an impl of this. It's not ready yet. I'll be able to submit a PR maybe next week. Currently, I'm able to read from jrt paths. But I'm facing some issues during checking against subTypes as described in #202
You can actually see the impl here https://github.com/xiumeteo/reflections/commits/issue-186-add-jrt-support but don't expect clean code yet.
Haha! actually I found another rock... http://openjdk.java.net/jeps/261 seems like this issue has to be a migration.
Hi guys I couldn't find the time to address this issue. I'll be looking at it but I don't have a estimation of completion
Any update on this? Also, how broken is this on java 9, does (like fast-classpath-scanner) everything still work fine when using solely the classpath? Or is the whole API "unusable"?
My understanding is that it works just fine, but not with modules. I haven't actually tried it, mind you, I'm basing this on my knowledge on how classpath scanning and modules work... but I'm flaky on the modules bit, so I might be wrong.
Hi, I figured out how to scan modules -- here's the solution:
https://stackoverflow.com/a/45612376/3950982
Has there been any progress on this? It would be great to support module based applications.
@tlf30 the module scanning method I posted above is included in the ClassGraph class path scanning library.
https://github.com/classgraph/classgraph
I posted the method here in case the Reflections author wanted to add it to Reflections, but that hasn't happened, so I wouldn't hold my breath!