码迷,mamicode.com
首页 > 编程语言 > 详细

java初步学习hello word

时间:2020-02-13 16:42:38      阅读:72      评论:0      收藏:0      [点我收藏+]

标签:meta   eclipse   htm   HERE   lang   ogr   一个   you   ref   

java初步学习hello word

 

1.下载 java JDK
http://www.oracle.com/technetwork/java/javase/downloads/index.html

2.安装 JDK

3.打开命令行

输入 java

按下 Enter

你会看到

Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
 
where options include:
-d32 use a 32-bit data model if available
 
-d64 use a 64-bit data model if available
-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 server,
because you are running on a server-class machine.
 
-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
-X print 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
 
java install successfull

4.打开编辑器.windows用户使用notepad,linux直接vi
(Eclipse 或者 Jbuilder 是常见的java开发工具)

写下一个小程序

public class Test {
public static void main(String[] args){
System.out.println("hello java");
}
}

保存到 E:\
名字为Test.java 路径 E:\Test.java

打开命令行

输入

E:
 
E:\ javac Test.java
 
E:\ java Test

结果:

hello java

 

java初步学习hello word

标签:meta   eclipse   htm   HERE   lang   ogr   一个   you   ref   

原文地址:https://www.cnblogs.com/yuexiaosheng/p/12303823.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!