I'm trying to compile a java code from Java 1.8 to Java 18 but I'm getting the error the type sun.net is not accessible
I've read some stuff online that sun.* cannot be used anymore. Is this related to this problem? If not are there any workarounds on this error?
P.S. I'm trying to use the HttpClient class
Quote from Oracle:
A Java program that directly calls into sun.* packages is not guaranteed to work on all Java-compatible platforms. In fact, such a program is not guaranteed to work even in future versions on the same platform.
To solve the issue, you will have to find the alternative to each missing class and replace it.
Source: Why Developers Should Not Write Programs That Call 'sun' Packages