javac - What Java features do you lose when using -source or -target directives for previous versions? -
so know javac can take -source flag allows specify java version should use compile source code:
- if use source 1.7 lose lambdas, type annotations, , default methods in interfaces 1.8.
- if use source 1.6 lose <>, try-with-resources, , multicatch 1.7.
- if use source 1.5 lose
@overridein interfaces. - if use source 1.4 lose generics, autoboxing, for/in, varargs, , enums.
- if use source 1.3 lose assertions.
but takes -target flag allows generate bytecode targeting specific jvm version. i'm interested in seeing list 1 above of features added in each version can make intelligent decision how far want -target. example, there version behind it's not recommended target, performance reasons or because language features break?
Comments
Post a Comment