It will depend a lot on the version with which you compile your .java files. Usually, in the IDE, when you create the project, you indicate the version of JDK that you are going to use. Apparently, it seems that you created the jar-calc project using JDK 7 (1.7.x), so it can be run with Java 7 or higher, as you mentioned, Java 8.
If you want your jar to be able to run with previous versions, you should make sure that when compiling your file the expected version is used. You can do this in multiple ways (examples pointing to Java 6).
In the IDE (Netbeans, Eclipse, IDEA, etc), you must ensure in the properties of the project, that points to the specific version of Java p.e. Java 6.
If you use maven, you can indicate the compiler and execution version by indicating it as properties in your pom (source: link ):
<project>
[...]
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
[...]
</project>
In gradle, you can add these lines in the build.gradle file:
apply plugin 'java'
sourceCompatibility = 1.6
targetCompatibility = 1.6
Executing from the command line, when using javac
, you can indicate the previous version (source: docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html):
javac -source 1.6 -target 1.6 <clases y carpetas a compilar>