Hi Rémi,
do you by any chance know if there is a legitimate way of doing the same
from another JVM, not the one the scanning code is loaded into? I've
seen your jigsaw-jrtfs, but that patch() part of it feels hacky and (if
I got it right) does not scale to more then one JDK instance.
On 30.12.2014 17:15, Remi Forax wrote:
Hi Cedric,
You can scan the module repository using a virtual FileSystem (NIO2)
that you can get with the prefix "jrt:/",
so you can write a code like this
FileSystem jrtFs = FileSystems.getFileSystem(new URI("jrt:/"));
for(Path root: jrtFs.getRootDirectories()) {
try(DirectoryStream<Path> directoryStream =
Files.newDirectoryStream(root)) {
for(Path path: directoryStream) {
System.out.println(path);
}
}
}
cheers,
Rémi
On 12/30/2014 01:57 PM, Cédric Champeau wrote:
Hi guys!
Sorry if it is a dumb question but finding information about Jigsaw
is not easy :) I was leveraging this end of year to adapt the Groovy
language build for JDK 9. The good news is that we seem to have very
little issues with Jigsaw. One of them is in a tool called "groovysh"
which is a REPL providing completion, like an IDE would. For example,
if you start typing jav<TAB> it would start completing the package
name. So far, the list of suggestions was based on elements on
classpath, and classes from the JDK were found thanks to scanning JAR
files.
The problem is that we now have a new (unsupported) URLConnection
type, which is JavaRuntimeURLConnection. I can see it can give me a
module name, but I have absolutely no idea what to do with that. For
a JAR it was easy because we could scan the entries, but now... Do
you have any pointer for code I could look at? It is made a bit
harder by the fact that even my IDE doesn't support JDK 9 so I cannot
have completion or whatever tools I used to work with when dealing
with new APIs ;)
Once this will be fixed, Groovy will officially support
building/running on JDK 9, which would be a nice New Year present :)
Thanks!