You can compile with 1.5 jdk with settings in javac.
In your case:
javac -source 1.5 -target 1.5
You can even install this in your IDE. Or you can do it with maven and maven.compile.target and maven.compile.properties
-source release
Indicates the version of the accepted source code. The following release values ββare allowed:
[...]
- 1,5
The compiler accepts code containing generics and other language functions introduced in JDK 5.
[...]
-target version
Generate class files for the specified version of the virtual machine. Class files will run on the specified target and in later versions, but not on earlier versions of the virtual machine. Acceptable goals: 1.1 1.2 1.3 1.4 1.5 (also 5 ) and 1.6 (also 6 ).
The default value for -target depends on the value of -source :
- If -source is not specified, the value of -target 1.6
- If -source 1.2 , value -target 1.4
- If -source 1.3 , value -target 1.4
For all other -source values, the -target value is the -source value.
Resources:
source share