Create config.py
Browse files
config.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# config.py
|
2 |
+
import os
|
3 |
+
|
4 |
+
def set_java_home():
|
5 |
+
"""Sets the JAVA_HOME environment variable if not already set."""
|
6 |
+
if 'JAVA_HOME' not in os.environ:
|
7 |
+
# You might want to make this configurable or detect it
|
8 |
+
os.environ['JAVA_HOME'] = '/usr/lib/jvm/java-11-openjdk-amd64'
|
9 |
+
print(f"JAVA_HOME was not set. Set to: {os.environ['JAVA_HOME']}")
|
10 |
+
else:
|
11 |
+
print(f"JAVA_HOME is already set to: {os.environ.get('JAVA_HOME')}")
|
12 |
+
|
13 |
+
# Call it at import time or ensure it's called before LanguageTool initialization
|
14 |
+
set_java_home()
|