good day, stackoverflow.
I've met with the fact, that setting with encoding options for my project for gradle in build.gradle, gradle.properties, gradlew, gradlew.bat does nothing in Intellij Idea. When I run task from command line such
gradlew name_of_the_task
it runs ok and the encoding settings that I've set in gradlew.bat are implemented. But when I run build for the same task in Intellij Idea it seems that this setting is not set.
I've tried many variants to set the jvm property, and the only 3 ways helps me:
In any of this cases project runs as it meant to run. Without that there is decoding problem. How can I set this param directly in project?
This one helps. Setting the default Java character encoding?
System.setProperty("file.encoding", "UTF-8");
Field cs = Charset.class.getDeclaredField("defaultCharset");
cs.setAccessible(true);
cs.set(null, null);
This code allows to set encoding on runtime.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.