站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2SE 专题谁能给我讲一下怎么在命令窗口中运行java程序啊????谢谢了

谁能给我讲一下怎么在命令窗口中运行java程序啊????谢谢了

摘要: 谁能给我讲一下怎么在命令窗口中运行java程序啊????谢谢了


你在窗口中运行要设置的是系统路径还是用户路径啊?路径设置好后怎么运行命令是什么啊?谢谢。


前面的问题不懂
后面的用java命令,如java helloworld
区分大小写,不用加文件扩展名


http://java.chinaitlab.com/JDK/29028.html


java Hellworld



这里有设置系统变量的方法
至于怎么运行看看书就知道了
http://lmtu.blog.sohu.com/entry/


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



楼上的,晕
这还用你列出来?


首先进入你保存文件的地方(用cd)
然后用javac命令再用java命令
例如你保存的文件是HelloWorld.java
(用java命令时是 javac HelloWorld.java (这是编译成字节码文件.class)
用java命令时是 java HelloWorld)


楼上的基本说对了
javac 文件名.java 是编译
java 文件名.class 是执行 .class可以不写


↑返回目录
前一篇: automoblie[] cars=new automoblie[5]
后一篇: Anmail fun() 返回个new Dog()有什么区别