简体   繁体   English

由于java.nio.charset.IllegalCharsetNameException导致VM初始化期间发生错误

[英]Error occurred during initialization of VM due to java.nio.charset.IllegalCharsetNameException

I am using gradle-2.5 version. 我正在使用gradle-2.5版本。 I am getting this error when I am trying to build an android project. 尝试构建android项目时出现此错误。

[abc_Android_App] $ /cip/opt/gradle-2.5/bin/gradle
Error occurred during initialization of VM
java.nio.charset.IllegalCharsetNameException: 
at java.nio.charset.Charset.checkName(Charset.java:303)
at java.nio.charset.Charset.lookup2(Charset.java:484)
at java.nio.charset.Charset.lookup(Charset.java:464)
at java.nio.charset.Charset.defaultCharset(Charset.java:609)
at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:56)
at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:111)
at java.io.PrintStream.<init>(PrintStream.java:104)
at java.io.PrintStream.<init>(PrintStream.java:151)
at java.lang.System.newPrintStream(System.java:1148)
at java.lang.System.initializeSystemClass(System.java:1192)

Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE

I have searched in Google for similar kind of error and found this type of error: 我在Google中搜索了类似的错误,并发现了此类错误:

Error occurred during initialization of VM
java.nio.charset.IllegalCharsetNameException: UTF-8 -Xmx4G -Xms4G 

which had a solution for it. 有一个解决方案。

But in my case, the error is not showing UTF-8 -Xmx4G -Xms4G , and due to which I am unable to guess where the issue lies. 但就我而言,该错误未显示UTF-8 -Xmx4G -Xms4G,由于该原因,我无法猜测问题出在哪里。

Please help me to get around this error. 请帮助我解决此错误。

Ps ( There is no space issue on slave) Ps(从站上没有空间问题)

Thanks in advance. 提前致谢。

Make sure you dont have "\\" [UTF-8] in the gradle.properties file like the below one. 确保gradle.properties文件中没有如下所示的“ \\” [UTF-8]。

org.gradle.jvmargs=-Xmx2048m -XX\:MaxPermSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8\

Correct one: 正确的一个:

org.gradle.jvmargs=-Xmx2048m -XX\:MaxPermSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM