Browse Source

makepanda: use javac from JAVA_HOME, check for deprecations

rdb 1 year ago
parent
commit
8a1d0f7a5a
1 changed files with 10 additions and 1 deletions
  1. 10 1
      makepanda/makepanda.py

+ 10 - 1
makepanda/makepanda.py

@@ -2072,7 +2072,16 @@ def CompileJava(target, src, opts):
     if GetHost() == 'android':
     if GetHost() == 'android':
         cmd = "ecj "
         cmd = "ecj "
     else:
     else:
-        cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
+        cmd = "javac "
+        home = os.environ.get('JAVA_HOME')
+        if home:
+            javac_path = os.path.join(home, 'bin', 'javac')
+            if GetHost() == 'windows':
+                javac_path += '.exe'
+            if os.path.isfile(javac_path):
+                cmd = BracketNameWithQuotes(javac_path) + " "
+
+        cmd += "-Xlint:deprecation "
 
 
     optlevel = GetOptimizeOption(opts)
     optlevel = GetOptimizeOption(opts)
     if optlevel >= 4:
     if optlevel >= 4: