简体   繁体   中英

Minecraft compiling .java to .class illegal characters & unclosed character literal

I am using the javac with command prompt to compile my .java to .class. This is for minecraft if it helps...

Here are the errors I am receiving :

C:\java\eh.java:269: unclosed character literal
/* 284  */    char c = '─Æ';
                   ^
C:\java\eh.java:269: illegal character: \8217
/* 284  */    char c = '─Æ';
                     ^
C:\java\eh.java:269: unclosed character literal
/* 284  */    char c = '─Æ';
                      ^
3 errors

This is the error code line in eclipse :

/* 284  */    char c = 'Ä’'; 

Any help is greatly appreciated! I can't seem to find an answer anywhere!

javac -encoding UTF-8 ...

那可能是一个多字节字符,被解释为ISO-8859-1,是两个字符。

You are on Windows right?

Add the following argument to your usage of javac :

-encoding UTF-8

Looks like you have two characters in one expression. If you changed to strings rather than characters it might compile. However, some of your characters aren't ASCII characters so you might have to use unicode escape sequences like '\a' to get it to compile.

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.

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