I have a class, which uses sun.rmi
API (read below for reasons). I want to use java 14 for compilation of my project, but it should run on java 7 as well. So I try to use javac -release 7
flag to cross-compile across versions. Alas, compilation fails with
error: package sun.rmi.transport does not exist
Is there any way to let compiler now that this is OK? :)
I develop a java agent which should instrument RMI transport via bytecode generation to pass some data along with each RMI call. So please do not tell me "you REALLY should not depend on internal APIs".