I compiled the following code using the Java-8 compiler:
package pack;
import sun.util.calendar.CalendarUtils;
public class A {
public static void main(String[] args) {
System.out.println(CalendarUtils.isGregorianLeapYear(2018));
}
}
I compiled the above code using the Java-8 compiler as:
gyan@gyan-pc:~/codes/java$ ~/Documents/softwares/Linux/jdk1.8.0_131/bin/javac -d . a.java
a.java:2: warning: CalendarUtils is internal proprietary API and may be removed in a future release
import sun.util.calendar.CalendarUtils;
^
a.java:9: warning: CalendarUtils is internal proprietary API and may be removed in a future release
System.out.println(CalendarUtils.isGregorianLeapYear(2018));
^
2 warnings
The default version of my Java interpreter is:
gyan@gyan-pc:~/codes/java$ java -version
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
And I can run the compiled code using the Java-9 interpreter without errors.
gyan@gyan-pc:~/codes/java$ java pack.a
false
According to my information: At runtime, the package "package" will be contained inside a special module called "Dimensionless module". The "moduleless module" requires all modules of the Java platform module. But only this package can be used by the "Nameless Module", which is exported by the corresponding module.
:
java.base "sun.util.calendar". , " " ?