![](/img/trans.png)
[英]Java runs in eclipse and will compile, but wont execute on cmd, but still runs in eclipse. How can I get it to execute in cmd?
[英]The java code can compile in cmd window, but can not run in eclipse
Java代码可以在cmd窗口中编译和运行,但是不能在eclipse中编译和运行。
//: io/MemoryInput.java
import java.io.*;
public class MemoryInput {
public static void main(String[] args)
throws IOException {
StringReader in = new StringReader(
BufferedInputFile.read("MemoryInput.java"));
int c;
while((c = in.read()) != -1){
System.out.print((char)c);
}
}
关于eclipse中的代码的错误信息是:
BufferedInputFile无法解析
BufferedInputFile
不是包java.io
一部分。 如果您在库中或某个文件夹中拥有该类,则必须将其包含在Eclipse中。
BufferedInputFile
不属于任何Java默认库。 因此,您必须将该类添加到您的类路径中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.