How do I compile a .java with support for older versions of Java?

后端 未结 5 1704
甜味超标
甜味超标 2020-11-27 04:43

I want to compile my .java\'s (several) into one .jar that are compatible with at least Java 1.6 and newer, preferably Java 1.5 and ne

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 05:20

    You can use the newest version of the JDK and set the source level to 1.5 - as long as you don't use classes / methods that were introduced after 1.5 you should be ok for all versions of the JVM 1.5 and above:

    -source 1.5

提交回复
热议问题