Java coding to solve the problems of java and groovy mixed

groovy use groovyc -j java文件 groovy文件this to compile the mix, but

When the java file that contains Chinese characters, the compiler will report GBK character cmd unrecognized, if it is Javac,

Then we only need to add -encoding utf-8on the line, but groovyc --encoding coding problems still occur.

Finding relevant information is not good, this problem was the use of a characteristic of groovyc: -Jxxx = xxx pass parameters to the javac:

Resolve as follows:

groovyc -j UseAGroovyClass.java -Jencoding=utf-8 AGroovyClass.groovy
Published 120 original articles · won praise 55 · views 130 000 +

Guess you like

Origin blog.csdn.net/le_17_4_6/article/details/104072673