I've just wanted to get to know what these particular settings really do:
- Project Properties -> Libraries -> Java Platform
- Project Properties -> Sources -> Source/Binary Format
After a little bit of googling I know, that: [1] By choosing a Java Platform I declare the minimum Java version which can run my jar file. I can't run my jar with Java 6 when I set the project's JDK to 7 or 8. [2] Second option ensures that I compile my sources with specified java version. Moreover, netbeans will check if I do not use any syntax unavailable in a specified java.
If I set my project as compatible with min Java 7 (Java Platform and Source format set to 7) I will have problems while running my jar file using jre 6 (it will be impossible).
Let me know if my thinking is now correct.
However there is one thing I do not understand and it forces me to think, that I make somewhere a mistake... Namely, it is possible to set, for instance, Java 8 as a Java Platform (so my app is compatible with Java 8+) but in source/binary format I can choose Java 6 or even Java 5. Why such a configuration is possible? What are the advantages of writing a source code using syntax from Java 6 when I use a Java 8 as a project's Java Platform??