首先,在环境变量中设置:
在path中写入:D:\Program Files\Java\jdk1.5.0\bin;D:\Program Files\Java\jdk1.5.0\jre\bin
注意:D:\Program Files\Java\jdk1.5.0\这个是你的JDK的安装地址
接着,
在classpath 中写入:
D:\Program Files\Java\jdk1.5.0\lib\dt.jar;D:\Program Files\Java\jdk1.5.0\lib\tools.jar
环境配置完成
这时候在CMD中输入javac ,结果显示JAVAC不是内部或外部命令,这时候不要灰心~~
在进行如下操作你就可以完成配置。
运行cmd ,在cmd 中通过CD 命令转到D:\Program Files\Java\jdk1.5.0\bin ,JAVAC就在里面
这时候输入JAVAC 有显示了,当你成功运行完一次JAVAC后,关掉CMD ,在此启动CMD时候,输入JAVAC,成功了!!!
-----------------------------------------
部分CD操作:
D:\Program Files\Java>cd jdk1.5.0
D:\Program Files\Java\jdk1.5.0>cd bin
D:\Program Files\Java\jdk1.5.0\bin>dir
驱动器 D 中的卷是 本地磁盘
卷的序列号是 1C46-1C72
D:\Program Files\Java\jdk1.5.0\bin 的目录
2007-04-21 03:20 <DIR> .
2007-04-21 03:20 <DIR> ..
2007-04-21 03:20 49,271 appletviewer.e
...........
D:\Program Files\Java\jdk1.5.0\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
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are
sed
-classpath <path> Specify where to find user class files
-cp <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
-endorseddirs <dirs> Override location of endorsed standards path
-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 relea
-target <release> Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options