jdk问题,求助

来源:百度知道 编辑:UC知道 时间:2024/06/06 12:06:44
我安装了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> Speci

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

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

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

问题没说清楚啊!!