I want to identify the package is provided by java or it user defined. Older version of java package starts with the java or javax.

But, with new merge and module structure my code is broken for the org.w3c.dom or org.sun these packages. Now, I want to list all packages have installed java. There are java commands to list modules “java --list-modules” and “java -d <modulename>”, but this will return the packages only for provided module. I want to get all packages (exported package not internal usage package) in single command output.