samyak152002 commited on
Commit
70b2638
·
verified ·
1 Parent(s): 1fb3760

Create config.py

Browse files
Files changed (1) hide show
  1. config.py +14 -0
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()