Skip to content

查找的时候报错cannot access class sun.net.util.IPAddressUtil #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Leonardo-Zhou opened this issue Nov 28, 2022 · 0 comments
Open

Comments

@Leonardo-Zhou
Copy link

        City db = new City("ip.ipdb");
        System.out.println(Arrays.toString(db.find("1.1.1.1", "CN")));

会报错
Exception in thread "main" java.lang.IllegalAccessError: class net.ipip.ipdb.Reader (in unnamed module @0x5479e3f) cannot access class sun.net.util.IPAddressUtil (in module java.base) because module java.base does not export sun.net.util to unnamed module @0x5479e3f
at net.ipip.ipdb.Reader.find(Reader.java:100)
at net.ipip.ipdb.City.find(City.java:36)
at org.example.Main.main(Main.java:23)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant