This simple one line java program triggers an error from the compiler:
import javax.*;
/home/srikanth/tmp/X.java:1: error: package javax does not exist
import javax.*;
^
This is confusing, since the following will compile just fine:
// ---
import javax.*;
import javax.swing.*;
// --
So will the following:
// ---
import javax.swing.*;
import javax.*;
// --
https://bugs.openjdk.java.net/browse/JDK-4869999 made the compiler insensitive to the order
of import statements, but the compiler is still relying on "side effects" for determining the observability of
packages.
Using the recursive version of JFM's list() should help here.
import javax.*;
/home/srikanth/tmp/X.java:1: error: package javax does not exist
import javax.*;
^
This is confusing, since the following will compile just fine:
// ---
import javax.*;
import javax.swing.*;
// --
So will the following:
// ---
import javax.swing.*;
import javax.*;
// --
https://bugs.openjdk.java.net/browse/JDK-4869999 made the compiler insensitive to the order
of import statements, but the compiler is still relying on "side effects" for determining the observability of
packages.
Using the recursive version of JFM's list() should help here.
- relates to
-
JDK-8151613 exports statement uses empty observable package
- Closed