When compiling code against a jar files contains classes in unnamed package, the following error message is produced:
$ javac -cp getuid.jar Test.java
Test.java:1: error: cannot access unnamed package
public class Test {
^
/getuid.class
1 error
The cause is that the jar file has /getuid.class entry instead of getuid.class. However, the same jar file works for JDK 8.
javap also reports class not found with the problematic jar, where javap in JDK 8 works.
$ javac -cp getuid.jar Test.java
Test.java:1: error: cannot access unnamed package
public class Test {
^
/getuid.class
1 error
The cause is that the jar file has /getuid.class entry instead of getuid.class. However, the same jar file works for JDK 8.
javap also reports class not found with the problematic jar, where javap in JDK 8 works.