Can I make a .jar file compatible with older java versions

I get this error:

enter image description here

due to my java version. I would like to create a .jar file compatible with older versions of Java, as well as newer versions. My computer is not a problem, but my audience uses older versions of Java. How can I make my program compatible with old versions as well as new versions and how far should I go with it?

+4
source share
5 answers

You can go back and compile your sources and create a new jar file with an older javac compatible with a specific version of java.

+5
source

, , java .

, : Java ant javac

0

UnsupportedClassVersionError JAR (JAR - zip-), JAR.

.class Java ByteCode, JVM ( Java) . Bytecode (Java 1991 .) , , , , JRE.

TL;DR: , , JRE. . JRE , , .

. .class J2SE 1.8, JRE7. JRE 1.8.

0

, Java, JDK . JVM, , /, JRE, JDK .

JRE, JRE. , JRE , , .

0

IDE NetBeans.

Run → Install project configuration → Configure → In the left pane, select "Sources". Finally, select the minimum version of the JDK in source / binary format.

0
source

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


All Articles