关于java环境变量的设置,请问是哪里的错?

[复制链接]
查看11 | 回复3 | 2008-12-9 09:12:19 | 显示全部楼层 |阅读模式
path为C:\Program Files\Java\jdk1.5.0_04\bin;C:\Program Files\Java\jdk1.5.0_04\jre\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin
classpath为.;C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\rt.jar;
java_home为C:\Program Files\Java\jdk1.5.0_04
运行后界面为
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>javac
'javac' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
C:\Documents and Settings\Administrator>java
Usage: java [-options] class [args...]

(to execute a class)
orjava [-options] -jar jarfile [args...]

(to execute a jar file)
where options include:

-client
to select the "client" VM

-server
to select the "server" VM

-hotspot
is a synonym for the "client" VM[deprecated]

The default VM is client.

-cp

-classpath

A ; separated list of directories, JAR archives,

and ZIP archives to search for class files.

-D=

set a system property

-verbose[:class|gc|jni]

enable verbose output

-version
print product version and exit

-version:

require the specified version to run

-showversionprint product version and continue

-jre-restrict-search | -jre-no-restrict-search

include/exclude user private JREs in the version search

-? -help
print this help message

-X
print help on non-standard options

-ea[:...|:]

-enableassertions[:...|:]

enable assertions

-da[:...|:]

-disableassertions[:...|:]

disable assertions

-esa | -enablesystemassertions

enable system assertions

-dsa | -disablesystemassertions

disable system assertions

-agentlib:[=]

load native agent library , e.g. -agentlib:hprof

see also, -agentlib:jdwp=help and -agentlib:hprof=help

-agentpath:[=]

load native agent library by full pathname

-javaagent:[=]

load Java programming language agent, see java.lang.instrument
C:\Documents and Settings\Administrator>

回复

使用道具 举报

千问 | 2008-12-9 09:12:19 | 显示全部楼层
classpath写错了,类路径;.;C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar;C:\Program Files\Java\jdk1.5.0_04\jre\lib\rt.jar; 错误处!!!应该是这样:C:\Program Files\Java\jdk1.5.0_04\lib\dt.jar这样写就行了:classpath是 .;%java_home%/lib/dt.jar;%java_home%/lib/tools.jarjavahome是 C:\Program Files\Java\jdk1.5.0...
回复

使用道具 举报

千问 | 2008-12-9 09:12:19 | 显示全部楼层
path设置:C:\Program Files\Java\jdk1.5.0_04\bin;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Fi...
回复

使用道具 举报

千问 | 2008-12-9 09:12:19 | 显示全部楼层
C:\Documents and Settings\Administrator>javac 'javac' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 可知,javac所在的路径系统无法识别,看你的path配置C:\Program Files\Java\jdk1.5.0_04\bin;没错啊~java命令他也识别出来了.可能是...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行