-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
9-repo-jigsaw
-
generic
-
generic
The following module is compiled fine while as it should not because no "requires jdk.desktop" is specified.
===== src/module-info.java =====
module test_completeness @ 1.0 {
requires jdk.base;
class test.completeness.desktop.Desktop;
}
===== src/test/completeness/desktop/Desktop.java =====
package test.completeness.desktop;
public class Desktop {
public static void main(String[] args) {
System.out.println("Hey");
{ javax.swing.SpringLayout.Constraints obj; }
}
}
=====
Then I compile it and run as
> ${JAVA_HOME}/bin/javac -d modules -modulepath modules -sourcepath src `find src/ -name *.java`
> ${JAVA_HOME}/bin/jmod install modules/src/ -L mlib test_completeness
> ${JAVA_HOME}/bin/java -L mlib -m test_completeness
===== src/module-info.java =====
module test_completeness @ 1.0 {
requires jdk.base;
class test.completeness.desktop.Desktop;
}
===== src/test/completeness/desktop/Desktop.java =====
package test.completeness.desktop;
public class Desktop {
public static void main(String[] args) {
System.out.println("Hey");
{ javax.swing.SpringLayout.Constraints obj; }
}
}
=====
Then I compile it and run as
> ${JAVA_HOME}/bin/javac -d modules -modulepath modules -sourcepath src `find src/ -name *.java`
> ${JAVA_HOME}/bin/jmod install modules/src/ -L mlib test_completeness
> ${JAVA_HOME}/bin/java -L mlib -m test_completeness