脑血管畸形头痛怎么办:jdk问题,求助

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 02:00:16
我安装了jdk,变量什么的都设好了,
在dos下输入 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
-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
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options

但我输入javac HelloWorld.java 时显示:

error: cannot read: HelloWorld.java
1 error

大小写也没什么问题,我把安装程序放在c盘,编的记事本文挡放在e盘的,有什么问题啊?

首先设置好环境变量,然后检查一下文件名是否是HelloWorld.java (有可能是HelloWorld.java .txt。.txt后缀名被隐藏了)。
最后运行
e:\>javac HelloWorld.java

编译器没有找到HelloWorld.java这个文件,需要在HelloWorld.java这个目录下进行编译

看一下public class 后面的是什么,大小写一定要正确,再有就是楼上所说

问题没说清楚啊!!