From 54a0a7f2ad2cbc694a2d43b46a3202017dc8a059 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 13 May 2021 01:58:39 -0500 Subject: [PATCH] fix: add xlint and file.encoding * Adding back '-J-Dfile.encoding=UTF-8' for javac so that its warning messages are printed in UTF-8 as well as its source files are treated as UTF-8 encoding. * Removing '-encoding UTF-8' for javac since that is covered by -J-Dfile.encoding=UTF-8 option * Adding back -Xlint for reaporting detailed warning messages for compilers * removing quotation marks around file.encoding and UTF-8 for java command, since java command does not understand quotation marks when it is not removed by shell (cmd.exe won't interpret that) Co-Authored-By: weather-tracker <34795700+weather-tracker@users.noreply.github.com> --- lib/grammars/java.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grammars/java.js b/lib/grammars/java.js index eac62878..de50aaf8 100644 --- a/lib/grammars/java.js +++ b/lib/grammars/java.js @@ -8,7 +8,7 @@ function JavaArgs(filepath, context) { const className = GrammarUtils.Java.getClassName(context) const classPackages = GrammarUtils.Java.getClassPackage(context) const tempFolder = GrammarUtils.createTempFolder("jar-") - const cmd = `javac -encoding UTF-8 -sourcepath '${sourcePath}' -d '${tempFolder}' '${filepath}' && java -D'file.encoding'='UTF-8' -cp '${tempFolder}' ${classPackages}${className}` + const cmd = `javac -encoding UTF-8 -J-Dfile.encoding=UTF-8 -Xlint -sourcepath '${sourcePath}' -d '${tempFolder}' '${filepath}' && java -Dfile.encoding=UTF-8 -cp '${tempFolder}' ${classPackages}${className}` return GrammarUtils.formatArgs(cmd) }