reflections icon indicating copy to clipboard operation
reflections copied to clipboard

Use "reflections" with Java 11 or higher

Open DavidShahbazyan opened this issue 4 years ago • 5 comments

Hello!

First things first: Thanks for creating such an awesome lib!

I'm trying to use "reflections" with Java 11, but it seems there is no "module-info.java" file. I've tried to adopt the lib for using with Java 11 and made this pull request (https://github.com/ronmamo/reflections/pull/305), but it has failed on Travis CI. Please, can anyone point me the right way of doing this, because this is my very first time when I'm trying to contribute to any project :)

Thanks again! David

DavidShahbazyan avatar Jan 03 '21 18:01 DavidShahbazyan

thanks @DavidShahbazyan , saw your pr and I'd like to merge it. if you wish to discuss or some guidance, feel free to reach out ronmamo at gmail

ronmamo avatar Sep 25 '21 17:09 ronmamo

Hello @ronmamo! Thanks, I'd be happy if I could have my small commitment in such a cool project. Please, let me know if there is anything that I can/should add/fix in my pr. Thanks again

DavidShahbazyan avatar Oct 06 '21 13:10 DavidShahbazyan

Hi, I have the problem with Java 17 reflect.getTypesAnnotatedWith(..) don't give me any result anymore, if I use it with package name. With ClasspathHelper.forClass(..) it works. Can you please tell me how Reflections work with Java modules and packages? Thanks

zetti12345 avatar Nov 24 '21 07:11 zetti12345

Hi, I have the problem with Java 17 reflect.getTypesAnnotatedWith(..) don't give me any result anymore, if I use it with package name. With ClasspathHelper.forClass(..) it works. Can you please tell me how Reflections work with Java modules and packages? Thanks

@zetti12345 Have you found solution?

alexander-ryabov avatar Mar 26 '24 02:03 alexander-ryabov

I have the same problem with modular app and OpenJDK 21.

Workaround:

var reflections = new Reflections(new ConfigurationBuilder()
                .setUrls(ClasspathHelper.forClass(Control.class)));

is working fine for me, but searching types by package returns empty results.

marcin-chwedczuk avatar Jun 25 '24 11:06 marcin-chwedczuk