question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scan results empty in JPMS jlink'd distribution

See original GitHub issue

I have this Main.java:

package test1;

import io.github.classgraph.ClassGraph;

public class Main {
	public static void main(String[]args){
		System.out.format("found: %s\n",
				new ClassGraph().enableClassInfo().whitelistPackages("test1").scan().getAllClasses());
	}
}

and also in test1: FindMe1.java:

package test1;

public class FindMe1 {
}

Running this normally finds both classes:

$ /usr/lib/jvm/java-11-openjdk/bin/java -p dependency -m test1/test1.Main
found: [public class test1.FindMe1, public class test1.Main]

Running this from a jlinked distribution (used moditect to generate):

$ ./jlink-image/bin/java -p modules -m test1/test1.Main
found: []

Currently looking for a workaround.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rendawcommented, Feb 10, 2019

Ah, FWIW .enableSystemJarsAndModules() does show all classes in this situation (regardless of order).

I suppose that’s obvious, I was a bit confused though - I thought I had .enableAllInfo() on (which wasn’t the case) and I thought enableAllInfo would include the SystemJars.

So I’m good for now since there’s that workaround.

0reactions
lukehutchcommented, Feb 13, 2019

Released in 4.8.0.

https://github.com/classgraph/classgraph/releases/tag/classgraph-4.8.0

Thanks for the bug report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found