The following code works fine on Java 8, but is throwing a warning on Java 9 and returning no results:
Reflections reflections = new Reflections();
Set<?> components = reflections.getSubTypesOf(componentClazz);
The warning is:
WARN org.reflections.Reflections - given scan urls are empty. set urls in the configuration
When trying to modify the code above to provide an explicit configuration and work with Java 9, the following code:
Reflections reflections = new Reflections(ClasspathHelper.forClass(Object.class));
Set<?> components = reflections.getSubTypesOf(componentClazz);
Returned this error:
WARN org.reflections.Reflections - could not create Vfs.Dir from url. ignoring the exception and continuing
org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [jrt:/java.base/]
either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.
The following code works fine on Java 8, but is throwing a warning on Java 9 and returning no results:
The warning is:
When trying to modify the code above to provide an explicit configuration and work with Java 9, the following code:
Returned this error: