java中的Long数据类型出错

use*_*521 2 java

实际上我的系统将Long.MAX_VALUE设为9223372036854775807

但是当我写这样的程序时,

package hex;

/**
 *
 * @author Ravi
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        long x = 9223372036854775807;

        System.out.println(x);

    }

}
Run Code Online (Sandbox Code Playgroud)

我收到编译时错误.任何人都可以解释原因吗?

Chr*_*odd 8

没有后缀,它是一个int常量(并且溢出),而不是长常量.坚持L到底.