Topic: Java编译问题

  Print this page

1.Java编译问题 Copy to clipboard
Posted by: EdwardKing
Posted on: 2007-12-21 09:18

我使用UltraEdit 13.00来进行文件的编写,进行文件保存的时候,是保存为UTF-8格式(由于项目需要,需要保存为UTF-8格式),如下所示:
package test;
import java.io.*;
public class a{
}

当我编译的时候,却发生错误:
C:\> javac a.java
a.java:1: 'class' or 'interface' expected
锘縫ackage test;
^
a.java:2: 'class' or 'interface' expected
import java.io.*;
^
2 errors

为什么会出现上面的错误呢?如何解决?

2.Re:Java编译问题 [Re: EdwardKing] Copy to clipboard
Posted by: JiafanZhou
Posted on: 2008-01-04 18:11

锘縫ackage test;

The above line is very suspicious, I suggest you save to another formats and try to compile your code, let me know if you still have the same problem.

Regards,
Jiafan

3.Re:Java编译问题 [Re: EdwardKing] Copy to clipboard
Posted by: liuqianqian
Posted on: 2008-01-28 20:56

是包的问题吧,你这样编译试试 javac -d . a.java
有空格啊!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923