JAVA入门(二)

前言

      本章介绍基本开发工具eclipse的使用

步骤

1.官网下载eclipse

网址:https://www.eclipse.org/downloads/packages/

JAVA入门(二)

推荐大家下载这个版本(Eclipse IDE for Java EE Developers),方便以后的学习。

注意:eclipse的版本需要和你的jdk版本一致,即32位jdk-->32位eclipse,64位jdk-->64位eclipse

附录:部分eclipse版本与jdk版本对应关系(http://wiki.eclipse.org/Eclipse/Installation


Eclipse 4.8 (Photon)

Eclipse 4.8 (Photon) was released on June 27, 2018. It is the supported release. See Photon schedule.

Consider using the Installer. Please see 5 Steps to Install Eclipse.

Java 8 or newer JRE/JDK is required to run all Oxygen packages based on Eclipse 4.7, including running the Installer. The reasoning behind requiring Java 8 are discussed here.

Eclipse 4.7 (Oxygen)

Eclipse 4.7 (Oxygen) was released on June 28, 2017. See Oxygen schedule.

Consider using the Installer. Please see 5 Steps to Install Eclipse.

Java 8 or newer JRE/JDK is required to run all Oxygen packages based on Eclipse 4.7, including running the Installer. The reasoning behind requiring Java 8 are discussed here.

Eclipse 4.6 (Neon)

Eclipse 4.6 (Neon) was released on June 22, 2016. See Neon schedule.

Consider using the Installer. Please see 5 Steps to Install Eclipse.

Java 8 JRE/JDK is required to run all Neon packages based on Eclipse 4.6, including the Installer. The reasoning behind requiring Java 8 are discussed here.

Eclipse 4.5 (Mars)

Eclipse 4.5 (Mars) was released on June 24, 2015.

Consider using the Installer! Please see 5 Steps to Install Eclipse.

Java 7 JRE/JDK is required for all Mars package downloads based on Eclipse 4.5, including the Installer. Information concerning tested configurations for Eclipse 4.5 is provided here.

Eclipse 4.4 (Luna)

Eclipse 4.4 (Luna) was released on June 25, 2014.

Java 7 JRE/JDK is required for most of the Luna package downloads based on Eclipse 4.4. Information concerning tested configurations for Eclipse 4.4 is provided here.

Eclipse 4.3 (Kepler)

Eclipse 4.3 (Kepler) was released in June 2013.

Java 6 JRE/JDK is recommended for Eclipse 4.3. More information concerning tested configurations for Eclipse 4.3 is provided here.


2.将下载好的eclipse解压缩,单击eclipse.exe即可运行eclipse

JAVA入门(二)

 3.使用eclipse运行上节提到的第一个java代码

(1)选择工作区间(以后的代码将全部放入这里)

JAVA入门(二)

 (2)新建java工程,我命名位java01,点击Finish

JAVA入门(二)

建好的工程如下:

JAVA入门(二) 

(3)点击src,右键新建class文件,我命名为Welcome

 JAVA入门(二)

Package为包名,java中确定一个类文件,以包名.类名确定。我这个就是com.jwang.test.Welcome

勾选main方法,该方法为程序的入口,点击Finish

JAVA入门(二)

输入上述代码后,在Welcome.java编辑区右键-->Run As-->Java Application进行运行(程序的编译是在你保存的时候eclipse自动完成的) ,执行后结果如下:

JAVA入门(二)

其结果和doc窗口下的相一致。