| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 832 人关注过本帖
标题:Help!Why!
只看楼主 加入收藏
lxh524
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-12-20
收藏
 问题点数:0 回复次数:11 
Help!Why!

help!help!
all the set path or classpath is ok but the error is only one , IS .....

C:\Documents and Settings\wl>cd c:\

C:\>cd jdk1.3.1_09

C:\jdk1.3.1_09>cd bin

C:\jdk1.3.1_09\bin>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-O Optimize; may hinder debugging or enlarge class file

-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are us
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-target <release> Generate class files for specific VM version


C:\jdk1.3.1_09\bin>javac Hello.java
error: cannot read: Hello.java
1 error

C:\jdk1.3.1_09\bin>java Hello.java
Exception in thread "main" java.lang.NoClassDefFoundError: Hello/java

C:\jdk1.3.1_09\bin>java Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello

C:\jdk1.3.1_09\bin>

搜索更多相关主题的帖子: Why Help 
2005-12-20 20:52
新坏男人
Rank: 1
等 级:新手上路
威 望:1
帖 子:38
专家分:0
注 册:2005-12-7
收藏
得分:0 
你的这个程序文件Hello.java 放在bin目录下了没有??

还是在其他地方重新建一个文件夹,把Hello.java放在那里

如在D盘建一个javatest的文件夹,把Hello.java放在 javatest文件夹里

编译的时候

C:\Documents and Settings\wl>d:

D:\ cd javatest

D:\javatest>javac Hello.java

/UploadFile/2005-11/2005112317153975.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www./UploadFile/2005-11/2005112317153975.gif');}" onmousewheel="return imgzoom(this);" alt="" />
2005-12-20 21:30
飘飘叶子
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:34
帖 子:597
专家分:10
注 册:2005-8-17
收藏
得分:0 
在bin文件夹下的只有命令而已,需要把你的目录转到你的文件所在目录下

向着软件工程师的目标前进!
2005-12-20 22:13
yanghl
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2005-12-21
收藏
得分:0 
光有命令也不可以啊,首先得设置path和classpath,它才识别

与Java共存亡!!
2005-12-22 15:21
bagger
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:33
帖 子:891
专家分:0
注 册:2005-8-16
收藏
得分:0 

再好好看看你弄的对不对吧!
就那几个地方好好看看有没有出错就是了啊!
path,classpath
只要这两个地方设对了就没有问题了啊!


【三元毕业设计论文】
三元论文真的只有三元钱
客服QQ:742670649
http://shop35094218./
2005-12-22 17:45
萍水相逢
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2005-12-21
收藏
得分:0 

你把hello.java文件放在bin 文件夹下了吗,要放在下面才能运行出来的.


2005-12-29 14:59
tody
Rank: 1
等 级:新手上路
威 望:2
帖 子:119
专家分:0
注 册:2005-11-17
收藏
得分:0 
晕,这是哪年的贴啊?!

记录就是用来破的, 自尊就是用来伤的。
2005-12-29 15:01
萍水相逢
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2005-12-21
收藏
得分:0 
你还可以在EditPlus2控制台下做的

2005-12-29 15:03
cll19820814
Rank: 2
等 级:新手上路
威 望:3
帖 子:328
专家分:0
注 册:2005-11-30
收藏
得分:0 
小新仁兄,你终于浮出水面了,快帮我看看怎么办啊~~

懵懵懂懂,看千遍而不会;设身处地,试一下就成功!
2005-12-29 15:07
tody
Rank: 1
等 级:新手上路
威 望:2
帖 子:119
专家分:0
注 册:2005-11-17
收藏
得分:0 
不好意思,眼花了,
错误的原因很简单,
无法找到Hello.java文件,
建议你强行指定路径 javac <-classpath> Hello.java

记录就是用来破的, 自尊就是用来伤的。
2005-12-29 15:07
快速回复:Help!Why!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016761 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved