Skip to content

Commit ceebbd9

Browse files
authored
Merge pull request #466 from Microsoft/jdk7upgrade
Upgrading (source|target)Compatibility version to 1.7, i.e. ending support for Java 6
2 parents d4ae36c + 1c53fe1 commit ceebbd9

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Introducing Telemetry Processor 'com.microsoft.applicationinsights.internal.channel.samplingV2.FixedRateSamplingTelemetryProcessor'
1717
- Introducing FixedRate Sampling v2 Using Telemetry Processors
1818
- Fixed issue #436 (TraceTelemetry with Severity is not shown in UI). This fixes a regression issue with `TelemetryClient.trackTrace` and `TelemetryClient.trackException`.
19+
- Compilation now targets Java 1.7. Java 1.6 is no longer supported.
1920

2021
## Version 1.0.10
2122
- `track()` method of 'com.microsoft.applicationinsights.TelemetryClient' is now modified. No longer performing pre-sanitization

gradle/common-java.gradle

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,27 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat;
2727

2828
apply plugin: 'java'
2929

30-
def java6JreDir = System.env.'JAVA_JRE_6'
31-
if (java6JreDir) {
32-
def requiredJava6Archives = ["rt.jar", "jsse.jar"]
30+
def java7JreDir = System.env.'JAVA_JRE_7'
31+
if (java7JreDir) {
32+
def requiredJavaBootArchives = ["rt.jar", "jsse.jar"]
3333
def bootClasspath = ""
34-
requiredJava6Archives.each { a ->
35-
def archivePath = new File(java6JreDir, "lib/$a")
34+
requiredJavaBootArchives.each { a ->
35+
def archivePath = new File(java7JreDir, "lib/$a")
3636
if (!archivePath.exists()) {
37-
throw new ProjectConfigurationException("Archive $archivePath required for building in Java 6 could not be found.", null)
37+
throw new ProjectConfigurationException("Archive $archivePath required for building in Java 7 could not be found.", null)
3838
}
3939
logger.info "Archive '$archivePath' added to boot class path"
4040
bootClasspath += "$archivePath;"
4141
}
4242
tasks.withType(JavaCompile) {
43-
sourceCompatibility = 1.6
44-
targetCompatibility = 1.6
43+
sourceCompatibility = 1.7
44+
targetCompatibility = 1.7
4545
options.bootClasspath = bootClasspath
4646
}
4747
} else {
48-
logger.warn "Environment variable 'JAVA_JRE_6' is not defined - falling back to use machine default Java SDK"
48+
// FIXME this warning only makes sense if the JDK version being used is > 1.7.
49+
// FIXME if this warning makes sense, it should be fatal if this is intended for release
50+
logger.warn "IMPORTANT: Environment variable 'JAVA_JRE_7' is not defined - Install JRE 7 and set 'JAVA_JRE_7' to prevent runtime compatibility issues!"
4951
}
5052

5153
if (hasProperty("JDKToUse")) {
@@ -63,6 +65,7 @@ if (hasProperty("JDKToUse")) {
6365
tasks.withType(AbstractCompile) {
6466
options.with {
6567
fork = true
68+
// FIXME forkOptions.executable is deprecated
6669
forkOptions.executable = javaExecutables.javac
6770
}
6871
}

0 commit comments

Comments
 (0)