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
Use CLASSPATH for scanning java9 system classes #1933
Milestone
Comments
Alternately use something like: Optional<ModuleReference> moduleRef = ModuleFinder.ofSystem().find("java.base");
if (moduleRef.isPresent())
{
ModuleReader reader = moduleRef.get().open();
String collect = reader.list()
.sorted()
.collect(Collectors.joining(System.lineSeparator()));
System.err.println(collect);
} |
I don't think these are mutually exclusive alternatives. According to "java --help" , -cp is still a valid argument, but they have also added:
According to the javadoc, you can retrieve these as system properties:
So IIUC, one must examine both the classpath and the module path in order to discover annotations. |
janbartel
added a commit
that referenced
this issue
Nov 15, 2017
janbartel
added a commit
that referenced
this issue
Nov 16, 2017
Committed to jetty-9.4.x and master branches. |
janbartel
added a commit
that referenced
this issue
Nov 21, 2017
This was referenced Nov 22, 2017
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In java8, the system classloader is a URLClassloader, so jar locations could be discovered when scanning for annotations. In java9, the classloader is no longer a URLClassloader, so when scanning system jars if a non URLClassloader parent loader is discovered, the System.property classpath should be used to find jars to scan.
This problem should be raised with the appropriate java mailing list to ask how are system jars meant to be scanned for discovered annotations?
The text was updated successfully, but these errors were encountered: