Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » 安装/配置/编译/环境  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 菜鸟请教,基本程序调试不通,急急急急急急!!!
myhandan





发贴: 4
积分: 0
于 2004-12-17 09:01 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我安装好之后,调试helloworld程序,运行javac helloworld.java没问题,能过, 但运行java helloword 时,却出现如下错误 :
Exception in thread "main " java.lang.NoclassDefFoundError :helloworld
请教各位大侠是何缘故,Applet小程序能调试成功!



作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
caike





发贴: 163
积分: 16
于 2004-12-17 09:15 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
应该是classpath没设好吧?
另外java是大小写敏感的,看看大小写有没有出问题



不想平庸的过一辈子
作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
rayel





发贴: 1
积分: 0
于 2004-12-17 11:02 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
潜水看看吧


作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
limlei





发贴: 8
积分: 0
于 2004-12-17 19:49 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
把你代码发上来看看呀


作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
nyao8448





发贴: 9
积分: 0
于 2004-12-17 20:19 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
是啊,发原代码


作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
thinking





发贴: 4
积分: 0
于 2004-12-19 15:28 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
classpath设置不正确SuN034

thinking edited on 2004-12-19 15:31

I think , therefore I am .
作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
myhandan





发贴: 4
积分: 0
于 2004-12-20 08:41 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
public class helloworld
{
public static void main(String args[])
{
System.out.println("Hello World!");
}
}

这是源代码,classpath应该怎么设置?我的j2sdk装在D盘,所以我的设置为D:\j2sdk1.4.2_06\lib\tools.jar; 不对吗?应该怎么设置



作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
myhandan





发贴: 4
积分: 0
于 2004-12-20 08:43 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
这是基本的程序,我也看大小写了,没错,请问应该怎么样正确设置path 和classpath,我觉得设置的应该没错


作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
mitnickcbc





发贴: 165
积分: 60
于 2004-12-20 09:06 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
查查置顶的文章


作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
aiff





发贴: 85
积分: 10
于 2004-12-20 11:24 user profilesend a private message to usersend email to aiffsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
设置为 D:\j2sdk1.4.2_06\bin;


作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
myhandan





发贴: 4
积分: 0
于 2004-12-20 11:56 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
你说的是class设置成这个吧,我的是这么设置的,class=d:\j2sdk1.4.2_06\bin
classpath=D:\j2sdk1.4.2_06\lib\tools.jar; 有错吗?



作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
aiff





发贴: 85
积分: 10
于 2004-12-20 13:39 user profilesend a private message to usersend email to aiffsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
错了 是Path=d:\j2sdk1.4.2_06\bin
明白了吗?



作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
tanytan





发贴: 22
积分: 0
于 2004-12-20 17:30 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
path=d:\j2sdk1.4.2_06\bin
classpath=.;D:\j2sdk1.4.2_06\lib\tools.jar;D:\j2sdk1.4.2_06\lib\dt.jar;



作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:tanytan]
sunfmin





发贴: 41
积分: 10
于 2004-12-20 21:27 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
tanytan wrote:
path=d:\j2sdk1.4.2_06\bin
classpath=.;D:\j2sdk1.4.2_06\lib\tools.jar;D:\j2sdk1.4.2_06\lib\dt.jar;


这样应该就不会出问题,重要的是 前面的 ".;"
这个表示当前路径。即把你的.class的文件的路径设置到classpath中。



作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
gf38670





发贴: 1
积分: 0
于 2004-12-20 21:55 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
path=d:\j2sdk1.4.2_06\bin
classpath=.
这样就好。JAVAC编译后生成的CLASS文件一般在当前文件夹。



作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
colo007

有点像.....



发贴: 62
积分: 2
于 2004-12-21 11:04 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
程序绝对没有问题。
classpath如果没有,自己添加。.;D:\j2sdk1.4.2_06\LIB\dt.JAR;D:\j2sdk1.4.2_06\LIB\TOOLS.JAR;D:\j2sdk1.4.2_06\BIN;
path中增加 D:\j2sdk1.4.2_06;D:\j2sdk1.4.2_06\bin;
试试,还有什么问题,继续跟贴!



Java vs VC,Who will win :-)
作者 Re:菜鸟请教,基本程序调试不通,急急急急急急!!! [Re:myhandan]
js_yy





发贴: 12
积分: 0
于 2004-12-24 11:28 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
执行:set classpath 命令查看classpath设置情况;看classpath是否为classpath=.;.......,
注意这个"."代表当前的文件目录,如果没有".",
执行:set classpath=.;%classpath%
再次查看classpath环境变量:set classpath
再运行你的程序

还有问题,把你的程序代码发出来!


js_yy edited on 2004-12-24 11:33

作者 Example: First Program of java [Re:myhandan]
js_yy





发贴: 12
积分: 0
于 2004-12-24 11:48 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
//程序
public class HelloWorld
{
  public static void main(String[] args)
  {
    System.out.println("Hello World!");
  }
}
Dos控制台:
set path=D:\j2sdk1.4.2_05\bin;%path%
这个要根据你安装JDK情况进行设置;
set classpath=.;%classpath%
运行这个程序,classpath设置成这样已经做够了,不需要添加其他的.jar文件
编译:
javac HelloWorld.java
运行:
java HelloWorld

行了不?


js_yy edited on 2004-12-24 11:59


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923