Any compilation flaw for java6 instead of java7?

If I compile my java7 jdk, I get a jar that works fine with java7 but obviously does not load using java6. If I compile with java7 jdk, but I specify output that will be compatible with java6, it works fine with both java6 jre and java7 jre.

My question is, is the first bank somehow “better” (faster, more efficient, more optimized) for working in java7 jre than the second? Is there a drawback for the java7 jre user to use the second, or is this second jar good enough for everyone?

My reasoning: I want the result to be as good as possible for java7 users, but I need something that can be run on java6. So do I need to provide two banks or only java6?

+4
source share
2 answers

Obviously, if you compile and run your code in Java 6, you cannot use classes that were added to the standard Java library in Java 7 because they will not be present in Java 6.

Otherwise, there is no practical difference. Almost all optimization is performed at run time by the JVM and JIT; The Java compiler barely optimizes.

+2
source

I don’t think that this is not so, if you are not using any new API from Java 7. I’m not 100% sure, I think that if your program is compiled using Java 6, it will still benefit from increased speed from people working on the Java 7 VM.

0

Source: https://habr.com/ru/post/1526959/


All Articles