-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Currently the stacktraces in native image doesn't show the module name, even when using a Java module.
One example is the following:
public class Main {
public static void main(String[] args) {
if (!Main.class.getModule().isNamed())
throw new AssertionError("Must be in a named module");
StackTraceElement stackTraceElement = new Exception().getStackTrace()[0];
String moduleName = stackTraceElement.getModuleName();
if (moduleName == null || "".equals(moduleName))
throw new AssertionError("Must be in a named module");
System.out.println("Hello from " + moduleName);
}
}
When using the module-path, I guess it should return the module name.