我是 linux 和一般编程的新手,我什至似乎无法运行简单的 Hello World 代码。以下是我所做的以及我收到的错误,我正在使用 Cygwin。谁能帮我?
theys@THEYS1 ~/java
$ vim test.java
theys@THEYS1 ~/java
$ ls
helloworld.java test.java
theys@THEYS1 ~/java
$ uname -a
CYGWIN_NT-6.1-WOW64 THEYS1 1.7.15(0.260/5/3) 2012-05-09 10:25 i686 Cygwin
theys@THEYS1 ~/java
$ cat test.java
public class test {
public static void main (String [] args) {
System.out.println ("Hello World!");
}
}
theys@THEYS1 ~/java
$ gcj --main=test -o test test.java
Exception in thread "main" java.lang.NoClassDefFoundError:
org.eclipse.jdt.internal.compiler.batch.GCCMain
at gnu.java.lang.MainThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException:
org.eclipse.jdt.internal.compiler.batch.GCCMain not found in
gnu.gcj.runtime.SystemClassLoader{urls=[],
parent=gnu.gcj.runtime.ExtensionClassLoader {urls=[], parent=null}}
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at gnu.java.lang.MainThread.run(Unknown Source)