当前位置: 技术问答>java相关
我的第一个java application程序,编译不通过,快来帮帮我这个初学者!
来源: 互联网 发布时间:2015-01-26
本文导语: first.java源文件: public class MyApplication { public static void main(String[] args) { MyApplication application = new MyApplication(); System.out.println("Application is running!"); } } 然后我在命令提示符下编译:javac first.java 报错如下...
first.java源文件:
public class MyApplication
{
public static void main(String[] args)
{
MyApplication application = new MyApplication();
System.out.println("Application is running!");
}
}
然后我在命令提示符下编译:javac first.java
报错如下:Exception in thread "main" Java.lang.NoClassDefFoundError:com/sun/tools/javac/Main
public class MyApplication
{
public static void main(String[] args)
{
MyApplication application = new MyApplication();
System.out.println("Application is running!");
}
}
然后我在命令提示符下编译:javac first.java
报错如下:Exception in thread "main" Java.lang.NoClassDefFoundError:com/sun/tools/javac/Main
|
faint!
文件名要和class名一致。
把你的first.java改成 MyApplication.java把
文件名要和class名一致。
把你的first.java改成 MyApplication.java把
|
first.java源文件:
public class first
{
public static void main(String[] args)
{
first application = new first();
System.out.println("Application is running!");
}
}
然后我在命令提示符下编译:javac first.java
public class first
{
public static void main(String[] args)
{
first application = new first();
System.out.println("Application is running!");
}
}
然后我在命令提示符下编译:javac first.java