Skip to content

Commit 90825e6

Browse files
committed
target java 8
1 parent 5d936d6 commit 90825e6

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

app/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,17 @@ java {
3939
}
4040
}
4141

42+
tasks.withType(JavaCompile) {
43+
options.release.set(8)
44+
}
45+
4246
application {
4347
// Define the main class for the application.
4448
mainClass = 'io.github.project516.NumberGuessingGame.Main'
4549
}
4650

4751
compileJava.dependsOn spotlessApply
52+
4853
spotless {
4954
java {
5055
googleJavaFormat('1.17.0').aosp()

app/src/main/java/io/github/project516/NumberGuessingGame/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class Main {
44
public static void main(String[] args) {
55
SystemInfo SysInfo = new SystemInfo();
6-
System.out.println("Java version: " + Runtime.version());
6+
System.out.println("Java version: " + SysInfo.version());
77
System.out.println("Vendor: " + SysInfo.vendor());
88
System.out.println("JDK name: " + SysInfo.name());
99
}

app/src/main/java/io/github/project516/NumberGuessingGame/SystemInfo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ String vendor() {
88
String name() {
99
return System.getProperty("java.vm.name");
1010
}
11+
12+
String version() {
13+
return System.getProperty("java.vm.version");
14+
}
1115
}

0 commit comments

Comments
 (0)