I checked the maven repository list of Azure ServiceBus, these versions after 0.9.8
are all built by Java 8 via check the pom.xml
file, the version 0.9.8
is built by Java 1.6. Therefore, there is not any released jar files compiled by Java 7 or other ealier Java version for the latest version 1.x.x
.
A workaround way for yours is manually to download the source codes of Azure ServiceBus from GitHub repo to compile it in maven by yourself. You can use JDK 7 to do it, even use JDK 8. The only changes you need is use 1.7
instead of 1.8
for the configuration of maven-compiler-plugin
in pom.xml
, such as below.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5</version>
<configuration>
<source>1.7</source> <!-- 1.8 -->
<target>1.7</target> <!-- 1.8 -->
<optimize>true</optimize>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
Note: If using JDK 8 to do this above for compiling with the javac
parameter -target 1.7 -source 1.7
, you must make sure there is not any code of using Java 8 features which will cause compiler error, such as error: lambda expressions are not supported in -source 1.7
for JDK 8. However, I roughly checked its source codes that there seems not to be. For more details about -target
or -source
for Javac 8, please see https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html.