1

Does the Java compiler work well if using a target level lower than the source level? For example:

javac -source 1.7 -target 1.6
Jacob
  • 75,331
  • 23
  • 142
  • 223
Jeremy Wang
  • 1,235
  • 1
  • 11
  • 18

1 Answers1

-2

if you compiler code use java 1.7,the code can not run with java 1.6,if you do this,you will receive a Unsupported major.minor version.

Pan
  • 97
  • 3
  • Err, yes it can, if it compiles and you use the -target 1.6 switch, which is what the question is about. – user207421 Oct 14 '16 at 06:11
  • I've just tried for modern source level 1.8 with bytecode target version 1.7 but it failed: **[javac] javac: source release 1.8 requires target release 1.8** – Splash Aug 04 '20 at 10:06