package logger;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Date;
public class MainLogger {
static PrintStream log;
public static void main(String[] args) {
VentanaLogger ventana = new VentanaLogger();
try {
log = new PrintStream( new FileOutputStream( "logger.log" , true) );
}catch (Exception e) {
System.out.println( "Error" + e);
}
log.println( "Inicio Logger " + (new Date()) );
ventana.setVisible( true );
}
}
我不知道为什么,但是在执行了这段简单的代码之后,Eclipse告诉我“错误:未找到或加载主类logger.Main Logger”,并且定义了main。
最佳答案
不确定,但软件包名称通常是小写字母(记录器不是Logger),也许这是问题所在。
关于java - 错误: main class logger.MainLogger not found or loaded,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64683131/