当前位置: 技术问答>java相关
———我是个菜菜鸟:Hello World 例子也不过,请问为啥!————
来源: 互联网 发布时间:2015-10-07
本文导语: public class hello { public static void main(String args[]) { System.out.println("hello world!!"); } } 调试过程: C:java>javac hello.java C:java>java hello Exception in thread "main" java.lang.NoClassDefFoundError: hello ...
public class hello
{
public static void main(String args[])
{
System.out.println("hello world!!");
}
}
调试过程:
C:java>javac hello.java
C:java>java hello
Exception in thread "main" java.lang.NoClassDefFoundError: hello
编译成功!但是"C:java>java hello"却给出下面的提示呢?
在jCreator LE 中却:
hello world!!
Press any key to continue...
这是怎么了?
{
public static void main(String args[])
{
System.out.println("hello world!!");
}
}
调试过程:
C:java>javac hello.java
C:java>java hello
Exception in thread "main" java.lang.NoClassDefFoundError: hello
编译成功!但是"C:java>java hello"却给出下面的提示呢?
在jCreator LE 中却:
hello world!!
Press any key to continue...
这是怎么了?
|
jCreator 再首次运行时指定了jdk的路径,在用jCreator编译,运行时会动态的用命令行设定路径
你的问题就是classpath设的不对。
给你个参考:
classpath = .;c:jdk1.3.1libtols.jar;c:jdk1.3.1libdt.jar;
你的问题就是classpath设的不对。
给你个参考:
classpath = .;c:jdk1.3.1libtols.jar;c:jdk1.3.1libdt.jar;
|
你在dos下,将当前目录转到你的hello.java文件所在的目录,然后执行相同的javac,java命令
|
试试把类名hello改成Hello
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。