ToxicScope / runtime_setup.py
nhdang117's picture
Super-squash branch 'main' using huggingface_hub
2d741b1
Raw History Blame Contribute Delete
407 Bytes
"""Make an optional portable JRE visible without changing the system PATH."""
from pathlib import Path
import os, shutil
def activate_java():
if shutil.which('java'): return True
root=Path(__file__).resolve().parent/'runtime/java'
for binary in root.glob('*/bin/java.exe'):
os.environ['PATH']=str(binary.parent)+os.pathsep+os.environ.get('PATH','')
return True
return False