Even the --release 9 and higher works with the warning.
The need here to stay with --release as 8.
Here is a sample repro.
import sun.misc.Unsafe;
public class test1 {
private Unsafe UNSAFE=null;
}
javac --release 8 test1.java
test1.java:1: error: package sun.misc does not exist
import sun.misc.Unsafe;
^
test1.java:3: error: cannot find symbol
private Unsafe UNSAFE=null;
^
symbol: class Unsafe
location: class test1
2 errors
javac --release 9 test1.java
test1.java:1: warning: Unsafe is internal proprietary API and may be removed in a future release
import sun.misc.Unsafe;
^
test1.java:3: warning: Unsafe is internal proprietary API and may be removed in a future release
private Unsafe UNSAFE=null;
^
2 warnings
While building the code with JDK 17 and --release as 8 , java compiler complains about the class https://github.com/lz4/lz4-java/blob/master/src/java-unsafe/net/jpountz/util/UnsafeUtils.java
Is there any alternate or fix available?
Even the --release 9 and higher works with the warning. The need here to stay with --release as 8.
Here is a sample repro. import sun.misc.Unsafe; public class test1 { private Unsafe UNSAFE=null; }
javac --release 8 test1.java test1.java:1: error: package sun.misc does not exist import sun.misc.Unsafe; ^ test1.java:3: error: cannot find symbol private Unsafe UNSAFE=null; ^ symbol: class Unsafe location: class test1 2 errors
javac --release 9 test1.java test1.java:1: warning: Unsafe is internal proprietary API and may be removed in a future release import sun.misc.Unsafe; ^ test1.java:3: warning: Unsafe is internal proprietary API and may be removed in a future release private Unsafe UNSAFE=null; ^ 2 warnings