0

I wrote my java code (maven) using jdk-14.0.1. but I need to ensure that it would run on jre 1.8. How can I check if my code is compatible with jre 1.8?

Sty
  • 39
  • 2
  • 9
  • 10
    when compiling it, indicate the target to be java 8. If you use incompatible features, it will tell you – njzk2 Aug 14 '20 at 17:26
  • 1
    Does this answer your question? [javac source and target options](https://stackoverflow.com/questions/15492948/javac-source-and-target-options) – Strikegently Aug 14 '20 at 18:11
  • 2
    That’s precisely what the option `--release 8` is for – Holger Aug 17 '20 at 09:18
  • 1
    With JDK 9 release, a tool called **jdeprscan** (https://docs.oracle.com/javase/9/tools/jdeprscan.htm#JSWOR-GUID-2B7588B0-92DB-4A88-88D4-24D183660A62) has been introduced, which will verify the compatibility and list no longer used APIs within your code, suggest alternatives as well. – Amit kumar Aug 17 '20 at 10:00
  • @njzk2 does this work for a maven project as well? – Sty Aug 17 '20 at 19:44

0 Answers0