| # config.py | |
| import os | |
| def set_java_home(): | |
| """Sets the JAVA_HOME environment variable if not already set.""" | |
| if 'JAVA_HOME' not in os.environ: | |
| # You might want to make this configurable or detect it | |
| os.environ['JAVA_HOME'] = '/usr/lib/jvm/java-11-openjdk-amd64' | |
| print(f"JAVA_HOME was not set. Set to: {os.environ['JAVA_HOME']}") | |
| else: | |
| print(f"JAVA_HOME is already set to: {os.environ.get('JAVA_HOME')}") | |
| # Call it at import time or ensure it's called before LanguageTool initialization | |
| set_java_home() |