0

If I write a library in a new version of Java, 17 for example, will it work with an older version of Java, 8 or 11 for example?

If there are some steps to make it work (like compiler settings), what are they, and will they make the library worse in the new version of Java?

matj1
  • 158
  • 1
  • 11
  • 2
    That would obviously depend on whether you use features that aren't available in those older versions. – OH GOD SPIDERS May 24 '22 at 08:28
  • 4
    Class files contain an information about which target language level the byte code was compiled for. You cannot run bytecode that was compiled for java9 with a java8 vm. You could of course take the source code and compile it yourself, but then it cannot use language features of newer versions. – f1sh May 24 '22 at 08:28
  • @OHGODSPIDERS Actually it doesn't. Code compiled for a higher version of Java cannot be run – g00se May 24 '22 at 09:18

0 Answers0