Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit eb80f77

Browse files
committed
Handle correctly the situation when a JVM picks up JAVA_TOOL_OPTIONS env
1 parent f0cf4b6 commit eb80f77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/net/adoptopenjdk/jdkapidiff/repackager/JdkRepackager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public String getVersion() {
113113

114114
private static String getVersion(Path javaHome) {
115115
List<String> output = ProcessExecutor.run( "java", Arrays.asList( javaHome.resolve( "bin" ).resolve( "java" ).toString(), "-version" ), javaHome.resolve( "bin" ) );
116-
String version = output.get( 0 );
116+
String version = output.get( 0 ).contains( "JAVA_TOOL_OPTIONS" ) ? output.get( 1 ) : output.get( 0 );
117117
return version.substring( version.indexOf( "\"" ) + 1, version.lastIndexOf( "\"" ) );
118118
}
119119

0 commit comments

Comments
 (0)