Skip to content

Commit

Permalink
include minimum jvm version in launch command (#10)
Browse files Browse the repository at this point in the history
(migrating existing commit from internal repo)

Specify minimum --jvm argument when launching the BSP install command.
This will allow coursier to attempt to find a version that matches if
already installed, or download one that meets the requirements. This
ensures a successful launch even in environments that do not have a new
enough jvm version installed.
  • Loading branch information
mnoah1 authored Jun 13, 2024
1 parent 2f6d85d commit 8637992
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class BazelBSPInstaller {
.join(' ')

// Full install command including flags.
const installCommand = `"${coursierPath}" launch ${MAVEN_PACKAGE}:${config.serverVersion} -M ${INSTALL_METHOD} -- ${flagsString}`
const installCommand = `"${coursierPath}" launch --jvm 11+ ${MAVEN_PACKAGE}:${config.serverVersion} -M ${INSTALL_METHOD} -- ${flagsString}`

// Report progress in output channel.
const installProcess = cp.spawn(installCommand, {cwd: root, shell: true})
Expand Down
1 change: 1 addition & 0 deletions src/test/suite/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ suite('BSP Installer', () => {

// Just confirm that coursier path was part of the spawn call, to leave flexibility for other changes to the command.
assert.ok(spawnStub.getCalls()[0].args[0].includes(coursierPath))
assert.ok(spawnStub.getCalls()[0].args[0].includes('--jvm 11+'))
assert.ok(installResult)
})

Expand Down

0 comments on commit 8637992

Please sign in to comment.