0

I have a java 8 lib that uses the java 8 features and my client need a jar that is compatible with the java 7 version. Is there a solution to compile java 8 sources to java 7 bytecode?

Thank's!

abdelmouheimen
  • 136
  • 2
  • 16
  • There is option for this, but it is possible if not using any java 8 specific features. In IntelliJ IDEA IDE, its language level. Check for the same in your IDE or command line option for it. – Dexter May 27 '21 at 09:10
  • **tl;dr** for the dupe: not with built-in tools. A retro-compiler or retroweaver could help, but it's not a 100% solution. – Joachim Sauer May 27 '21 at 09:10
  • If the sources don't use any features introduced with Java 8 (e.g. lambdas) it should be doable. If they are using those features you'd have to refactor the sources first. – Thomas May 27 '21 at 09:11
  • Watch this post: https://stackoverflow.com/questions/18162519/set-java-compiler-compliance-level – Dexter May 27 '21 at 09:11
  • Also: for pete's sake: who's still stuck on Java 7? The last free update was 6 years ago! – Joachim Sauer May 27 '21 at 09:13

0 Answers0