如何检查是否安装了java环境

Python011

如何检查是否安装了java环境,第1张

点击开始菜单,输入cmd

在cmd窗口中输入java,如果提示下面的内容,表面jdk,jre已经安装了

如果提示 

‘java’ 不是内部或外部命令,也不是可运行的程序或批处理文件。 

表明jdk没有安装

打开左下角任务栏中的开始按钮,输入“cmd”点回车

在dos面板中输入“java”点击回车,

出现如下界面:

C:\Documents and Settings\xxx>java -ver

Unrecognized option: -ver

Could not create the Java virtual machine.

C:\Documents and Settings\zyx>java -version

java version "1.6.0_07"

Java(TM) SE Runtime Environment (build 1.6.0_07-b06)

Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

C:\Documents and Settings\zyx>java

Usage: java [-options] class [args...]

(to execute a class)

or java [-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 <class search path of directories and zip/jar files>

-classpath <class search path of directories and zip/jar files>

A separated list of directories, JAR archives,

and ZIP archives to search for class files.

-D<name>=<value>

set a system property

-verbose[:class|gc|jni]

enable verbose output

-version print product version and exit

-version:<value>

require the specified version to run

-showversion print 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

-Xprint help on non-standard options

-ea[:<packagename>...|:<classname>]

-enableassertions[:<packagename>...|:<classname>]

enable assertions

-da[:<packagename>...|:<classname>]

-disableassertions[:<packagename>...|:<classname>]

disable assertions

-esa | -enablesystemassertions

enable system assertions

-dsa | -disablesystemassertions

disable system assertions

-agentlib:<libname>[=<options>]

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

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

-agentpath:<pathname>[=<options>]

load native agent library by full pathname

-javaagent:<jarpath>[=<options>]

load Java programming language agent, see java.lang.instrument

-splash:<imagepath>

show splash screen with specified image

C:\Documents and Settings\xxx>

然后dos面板中输入“javac”

出现java文件说明

最后在dos面板中输入 “java -version”

出现java版本号,完成以上步骤就说明JAVA变量环境已经在电脑上安装好了

C:\Documents and Settings\xxx>java -version

java version "1.6.0_07"

Java(TM) SE Runtime Environment (build 1.6.0_07-b06)

Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)