31
31
import org .openjdk .jmh .util .Utils ;
32
32
import org .slf4j .Logger ;
33
33
import org .slf4j .LoggerFactory ;
34
+ import org .springframework .boot .system .JavaVersion ;
34
35
35
36
import com .example .InterceptorApplication ;
36
37
@@ -52,7 +53,7 @@ public ProcessLauncherState(String dir, String... args) {
52
53
this .args .add (count ++, System .getProperty ("java.home" ) + "/bin/java" );
53
54
this .args .add (count ++, "-Xmx128m" );
54
55
this .args .add (count ++, "-cp" );
55
- this .args .add (count ++, getClasspathJdk9 ());
56
+ this .args .add (count ++, getClasspath ());
56
57
this .args .add (count ++, "-Djava.security.egd=file:/dev/./urandom" );
57
58
this .args .add (count ++, "-XX:TieredStopAtLevel=1" ); // zoom
58
59
if (System .getProperty ("bench.args" ) != null ) {
@@ -74,6 +75,13 @@ public void setJvmArgs(String... extraArgs) {
74
75
this .jvmArgs = Arrays .asList (extraArgs );
75
76
}
76
77
78
+ String getClasspath () {
79
+ if (JavaVersion .getJavaVersion ().isOlderThan (JavaVersion .NINE )) {
80
+ return getClasspathJdk8 ();
81
+ }
82
+ return getClasspathJdk9 ();
83
+ }
84
+
77
85
String getClasspathJdk8 () {
78
86
StringBuilder builder = new StringBuilder ();
79
87
0 commit comments