beam icon indicating copy to clipboard operation
beam copied to clipboard

Update ExternalJavaProvider.available method to support Windows systems

Open eug opened this issue 1 year ago • 1 comments

The current implementation of the ExternalJavaProvider.available method only supports Unix/Linux systems. This issue aims to update the function to also support Windows systems.

Changes:

The available method will be updated to use the where command on Windows systems, instead of the which command used on Unix/Linux systems.

New implementation:

class ExternalJavaProvider(ExternalProvider):
  def __init__(self, urns, jar_provider):
    super().__init__(
        urns, lambda: external.JavaJarExpansionService(jar_provider()))
    self._jar_provider = jar_provider

  def available(self):
      cmd = 'where' if sys.platform == 'win32' else 'which'
      return subprocess.run([cmd, 'java'], capture_output=True).returncode == 0

eug avatar May 10 '24 02:05 eug

This issue has been marked as stale due to 150 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that’s incorrect or this issue still needs to be addressed, please simply write any comment. If closed, you can reopen the issue at any time. Thank you for your contributions.

github-actions[bot] avatar Dec 05 '25 12:12 github-actions[bot]