Skip to content

Commit e730f08

Browse files
authored
fix: add xlint and file.encoding to Java (#2471)
Co-authored-by: weather-tracker <[email protected]> Co-authored-by: Amin Yahyaabadi <[email protected]> * Adding back '-J-Dfile.encoding=UTF-8' for javac so its warning messages are printed in UTF-8 as well as its source files are treated as UTF-8 encoding. * Adding back -Xlint for reporting 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 the shell (cmd.exe won't interpret that) update for issue #1166
1 parent 9143300 commit e730f08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grammars/java.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function JavaArgs(filepath, context) {
88
const className = GrammarUtils.Java.getClassName(context)
99
const classPackages = GrammarUtils.Java.getClassPackage(context)
1010
const tempFolder = GrammarUtils.createTempFolder("jar-")
11-
const cmd = `javac -encoding UTF-8 -sourcepath '${sourcePath}' -d '${tempFolder}' '${filepath}' && java -D'file.encoding'='UTF-8' -cp '${tempFolder}' ${classPackages}${className}`
11+
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}`
1212
return GrammarUtils.formatArgs(cmd)
1313
}
1414

0 commit comments

Comments
 (0)