Skip to content

Commit

Permalink
Fix newer version scheme for java_home calling (TheInfiniteKind#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Nov 20, 2023
1 parent a4d5efb commit ca47f06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion appbundler/native/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,9 @@ int launch(char *commandName, int progargc, char *progargv[]) {
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/libexec/java_home"];

NSArray *args = [NSArray arrayWithObjects: @"-v", [NSString stringWithFormat:@"1.%i%@", jvmRequired, exactMatch?@"":@"+"], nil];
NSString *versionPattern = (jvmRequired > 8) ? @"%i%@" : @"1.%i%@";

NSArray *args = [NSArray arrayWithObjects: @"-v", [NSString stringWithFormat:versionPattern, jvmRequired, exactMatch?@"":@"+"], nil];
[task setArguments:args];

NSPipe *stdout = [NSPipe pipe];
Expand Down

0 comments on commit ca47f06

Please sign in to comment.