Gradle using wrong encoding
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 59
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
When I try to build the version it prints a weird error message:
> Task :versions:v1_20_6:compileJava
G:\projects\mache\versions\1.20.6\src\main\java\net\minecraft\ChatFormatting.java:40: error: unclosed character literal
public static final char PREFIX_CODE = '§';
^
G:\projects\mache\versions\1.20.6\src\main\java\net\minecraft\ChatFormatting.java:40: error: illegal character: '\u00a7'
public static final char PREFIX_CODE = '§';
^
G:\projects\mache\versions\1.20.6\src\main\java\net\minecraft\ChatFormatting.java:40: error: unclosed character literal
public static final char PREFIX_CODE = '§';
^
G:\projects\mache\versions\1.20.6\src\main\java\net\minecraft\server\level\ChunkMap.java:298: error: unclosed character literal
string = string + '§' + fullStatus.ordinal() + fullStatus;
^
G:\projects\mache\versions\1.20.6\src\main\java\net\minecraft\server\level\ChunkMap.java:298: error: illegal character: '\u00a7'
string = string + '§' + fullStatus.ordinal() + fullStatus;
^
G:\projects\mache\versions\1.20.6\src\main\java\net\minecraft\server\level\ChunkMap.java:298: error: unclosed character literal
string = string + '§' + fullStatus.ordinal() + fullStatus;
^
G:\projects\mache\versions\1.20.6\src\main\java\net\minecraft\server\level\ChunkMap.java:298: error: not a statement
string = string + '§' + fullStatus.ordinal() + fullStatus;
^
7 errors
FAILURE: Build failed with an exception.
This is due to incorrect encoding settings.
Setting this property in gradle.properties fixes the issue.
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by checking gradle.properties and the reported compileJava failure involving the § character in ChatFormatting.java and ChunkMap.java. Apply the stated UTF-8 Gradle setting, then rerun the build; done means these sources compile without the encoding-related errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100