eclipse使用教程
Eclipse IDE开发环境使用教程说明书

iAbout the T utorialEclipse is an integrated development environment (IDE) for Java and other programming languages like C, C++, PHP, and Ruby etc. Development environment provided by Eclipse includes the Eclipse Java development tools (JDT) for Java, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others.This tutorial will teach you how to use Eclipse in your day-2-day life while developing any software project using Eclipse IDE. We will give special emphasis on Java project. AudienceThis tutorial has been prepared for beginners to help them understand basic functionality of Eclipse tool. After completing this tutorial, you will find yourself at a moderate level of expertise in using Eclipse IDE from where you can take yourself to next levels. PrerequisitesWe assume you are going to use Eclipse IDE to handle all levels of Java projects development. So it will be good if you have knowledge of software development using any programming language specially Java programming.Copyright & Disclaimer© Copyright 2015 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book can retain a copy for future reference but commercial use of this data is not allowed. Distribution or republishing any content or a part of the content of this e-book in any manner is also not allowed without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or inthistutorial,******************************************iT able of ContentsAbout the Tutorial (i)Audience (i)Prerequisites (i)Copyright & Disclaimer (i)Table of Contents .................................................................................................................................... i i 1.OVERVIEW (1)What is Eclipse? (1)Licensing (1)Eclipse Releases (1)2.INSTALLATION (3)Downloading Eclipse (3)Installing Eclipse (3)Launching Eclipse (4)3.EXPLORE WINDOWS (5)Parts of an Eclipse Window (5)Using Multiple Windows (6)4.EXPLORE MENUS (7)Typical Eclipse Menus (7)Brief Description of Menus (8)Customizing Menus (8)5.EXPLORE VIEWS (9)About Views (9)Organizing Views (9)Moving Views (9)Creating View Folders (10)Opening a view (10)6.PERSPECTIVES (13)What is a Perspective? (13)Opening a Perspective (13)Switching between Perspectives (13)Closing a Perspective (14)Customizing a Perspective (14)7.WORKSPACES (16)About Eclipse Workspace (16)UI Elements for Managing the Workspace (16)8.CREATE JAVA PROJECT (18)Opening the New Java Project wizard (18)Using the New Java Project wizard (18)Viewing the Newly Created Project (20)9.CREATE JAVA PACKAGE (21)Opening the New Java Package wizard (21)Using the New Java Package Wizard (21)Viewing the Newly Created Package (22)10.CREATE JAVA CLASS (23)Opening the New Java Class Wizard (23)Using the New Java Class Wizard (23)Viewing the Newly Created Java class (24)11.CREATE JAVA INTERFACE (25)Opening the New Java Interface Wizard (25)Using the New Java Interface Wizard (25)Viewing the Newly Created Java Interface (26)12.CREATE XML FILE (27)Opening the New XML File wizard (27)Using the New XML File wizard (28)Viewing the Newly Created XML File (29)13.JAVA BUILD PATH (30)Setting the Java Build Path (30)14.RUN CONFIGURATION (31)Creating and Using a Run Configuration (31)15.RUNNING A PROGRAM (33)Running a Java Program (33)16.CREATE JAR FILES (35)Opening the Jar File wizard (35)Using the Jar File wizard (35)17.CLOSE PROJECT (37)Why Close a Project? (37)How to Close a Project? (37)Closed Project in Package Explorer (38)18.REOPEN PROJECT (39)Reopening a Closed Project (39)19.BUILD PROJECT (40)Building a Java Project (40)20.DEBUG CONFIGURATION (42)Creating and Using a Debug Configuration (42)21.DEBUGGING A PROGRAM (44)Debugging a Java Program (44)22.PREFERENCES (48)Setting Preferences (48)23.CONTENT ASSIST (50)Using Content Assist (50)24.QUICK FIX (52)Using Quix Fix (52)25.HOVER HELP (54)Using Hover Help (54)26.SEARCH MENU (56)Searching the Workspace (56)27.NAVIGATION (58)Navigating the Eclipse Workspace (58)Open Type (58)Open Type in Hierarchy (60)Open Resource (61)28.REFACTORING (63)Refactoring using Eclipse (63)29.ADD BOOKMARKS (64)About Bookmarks (64)Adding a Bookmark (64)Opening the Bookmarks View (64)Using the Bookmarks View (65)30.TASK MANAGEMENT (66)Managing Tasks (66)Opening the Tasks View (67)Using the Tasks View (67)31.INSTALL PLUGINS (69)Locating and Installing Plug-ins (69)32.CODE TEMPLATES (73)Using Code Templates (73)Modifying/Adding code templates (74)33.SHORTCUTS (75)About Shortcuts (75)34.RESTART OPTION (78)Restarting Eclipse (78)35.TIPS & TRICKS (79)36.WEB BROWSERS (81)Internal Web Browser (81)Eclipse 7What is Eclipse?In the context of computing, Eclipse is an integrated development environment (IDE) for developing applications using the Java programming language and other programming languages such as C/C++, Python, PERL, Ruby etc.The Eclipse platform which provides the foundation for the Eclipse IDE is composed of plug-ins and is designed to be extensible using additional plug-ins. Developed using Java, the Eclipse platform can be used to develop rich client applications, integrated development environments, and other tools. Eclipse can be used as an IDE for any programming language for which a plug-in is available.The Java Development Tools (JDT) project provides a plug-in that allows Eclipse to be used as a Java IDE, PyDev is a plugin that allows Eclipse to be used as a Python IDE, C/C++ Development Tools (CDT) is a plug-in that allows Eclipse to be used for developing application using C/C++, the Eclipse Scala plug-in allows Eclipse to be used an IDE to develop Scala applications and PHPeclipse is a plug-in to eclipse that provides complete development tool for PHP.LicensingEclipse platform and other plug-ins from the Eclipse foundation is released under the Eclipse Public License (EPL). EPL ensures that Eclipse is free to download and install. It also allows Eclipse to be modified and distributed.Eclipse ReleasesEvery year, since 2006, the Eclipse foundation releases the Eclipse Platform and a number of other plug-ins in June.1.Eclipse8Eclipse 9Downloading EclipseYou can download eclipse from /downloads/. The download page lists a number of flavors of eclipse.The capabilities of each packaging of eclipse are different. Java developers typically use Eclipse Classic or Eclipse IDE for developing Java applications.The drop down box in the right corner of the download page allows you to set the operating system on which eclipse is to be installed. You can choose between Windows, Linux and Mac. Eclipse is packaged as a zip file.Installing EclipseTo install on windows, you need a tool that can extract the contents of a zip file. For example you can use:∙7-zip ∙PeaZip ∙ IZArcUsing any one of these tools, extract the contents of the eclipse zip file to any folder of your choice.2.Launching EclipseOn the windows platform, if you extracted the contents of the zip file to c:\, then you can start eclipse by using c:\eclipse\eclipse.exeWhen eclipse starts up for the first time it prompts you for the location of the workspace folder. All your data will be stored in the workspace folder. You can accept the default or choose a new location.1011If you select "Use this as the default and do not ask again", this dialog box will not come up again. You can change this preference using the Workspaces Preference Page. See the Preference tutorialpage for more details.Eclipse 12Parts of an Eclipse WindowThe major visible parts of an eclipse window are:∙Views ∙Editors (all appear in one editor area) ∙Menu Bar ∙ ToolbarAn eclipse perspective is the name given to an initial collection and arrangement of views and an editor area. The default perspective is called java. An eclipse window can have multiple perspectives open in it but only one perspective can be active at any point of time. A user can switch between open perspectives or open a new perspective. A perspective controls what appears in some menus and tool bars.3.EclipseA perspective has only one editor area in which multiple editors can be open. The editor area is usually surrounded by multiple views. In general, editors are used to edit the project data and views are used to view the project metadata. For example, the package explorer shows the java files in the project and the java editor is used to edit a java file.The eclipse window can contain multiple editors and views but only one of them is active at any given point of time. The title bar of the active editor or view looks different from all the others.The UI elements on the menu bar and tool bar represent commands that can be triggered by an end user.Using Multiple WindowsMultiple Eclipse Windows can be open at the same time. To open a new window, click on the Windows menu and select the New Window menu item.Each window can have a different perspective open in them. For example you could open two Eclipse windows one in the Java perspective and the other in the Debug perspective. The window showing the Java perspective can be used for editing the java code and the window showing the debug perspective can be used for debugging the application being developed.13Eclipse 14T ypical Eclipse MenusThe typical menus available on the menu bar of an Eclipse window are:∙File menu ∙Edit menu ∙Navigate menu ∙Search menu ∙Project menu ∙Run menu ∙Window menu ∙ Help menu4.Plug-ins can add new menus and menu items. For example when the java editor is open, you will see the Source menu and when the XML editor is open, you will see the Design menu. Brief Description of Menus15Customizing MenusThe visible menu items on a menu depend on the installed plug-ins and customization done using the Customize Perspective dialog box.16Eclipse 17About ViewsEclipse views allow users to see a graphical representation of project metadata. For example the project navigator view presents a graphical representation of the folders and files associated with a project and properties view presents a graphical representation of an element selected in another view or editor.An eclipse perspective can show any number of views and editors. All editor instances appear in a single editor area, whereas views are placed inside view folders. A workbench window can display any number of view folders. Each view folder can display one or more views. Organizing ViewsThe following picture shows four views arranged in a view folder.The picture given below shows the same four views arranged in two view folders.5.Moving ViewsTo move a view from one view folder to another, just click on the view title and drag to the title bar area of another view folder. The green line shown below is a result of dragging the title bar of the Properties view from one view folder to the title bar area of another view folder. The Properties view can be moved to where the green line is by releasing the mouse button and sending out a drop event.Creating View FoldersView folders can be dynamically created by dragging the title bar of a view to anywhere outside the editor area and title bar of another view folder. As you drag the title bar around, green lines will indicate where exactly the new view folder will be created.Moving the drag icon to the bottom of a window allows you to create a view folder that spans the entire width of the window. Moving the drag icon to the left or right edge of window allows you to create a view folder that spans the entire height of the window.18Opening a viewTo open a view, click on the Window menu and select the Show View menu item.19Clicking on the Other menu item brings up the Show View dialog box that allows you to locate and activate a view.20The views are organized by category. To quickly locate a view, just type the name of a view into the filter text box. To open a view, select it and click on the OK button. The subsequent pages of this tutorial introduce you to a number of useful views.21End of ebook previewIf you liked what you saw…Buy it from our store @ https://22。
eclipse的使用教程

eclipse的使用教程Eclipse是一个功能强大的集成开发环境(IDE),主要用于开发Java应用程序。
它提供了许多功能和工具,帮助开发人员更高效地编写、调试和管理代码。
在本篇教程中,我们将介绍Eclipse的基本使用方法,以帮助你上手这个强大的开发工具。
一、Eclipse的安装和配置1. 首先,你需要下载适用于你的操作系统的Eclipse安装包。
你可以从Eclipse官方网站上找到最新的版本进行下载。
2. 下载完成后,解压缩安装包并将其放置在一个你喜欢的位置。
打开解压缩后的文件夹,你将看到一个“eclipse.exe”或“eclipse”可执行文件。
3. 双击可执行文件以启动Eclipse。
在第一次启动时,你将被要求选择一个工作空间(Workspace),它是用于存储你的项目和相关文件的文件夹。
选择一个合适的文件夹并点击“OK”按钮。
4. 启动后,你将看到Eclipse的主界面。
你可以在窗口上方的工具栏中找到各种功能和选项。
二、创建新项目1. 在Eclipse的主界面上方的工具栏中,找到“File”菜单并点击它。
2. 在下拉菜单中,选择“New”选项。
然后,你将看到一个子菜单,点击“Java Project”选项。
3. 在弹出窗口中,输入你的项目名称并点击“Finish”按钮。
Eclipse将自动创建一个新的Java项目,并在你的工作空间文件夹中创建一个相应的文件夹。
三、编写代码1. 在Eclipse的主界面的左侧,你将看到一个“Package Explorer”视图。
在其中,你可以看到你的项目和相关文件夹的层次结构。
2. 右键点击你的项目,并选择“New”选项。
然后,选择“Class”选项。
3. 在弹出窗口中,输入你的类的名称和所属的包名,并选择其他相关选项。
然后,点击“Finish”按钮。
Eclipse将自动在你的项目中创建一个包和一个类文件。
4. 在类文件中,你可以开始编写你的Java代码。
eclipse 操作技巧

eclipse是一个基于插件的开源项目,功能很强大,除了java外,通过安装插件可以编写大多数常用语言,可以说是一个非常强大,全面的ide开发工具。
所以这里有必要介绍一下它的一些使用技巧,便于开发。
这些技巧包括常用菜单、界面的操作和快捷键的使用。
◆Eclipse可以建立多个工作区,每个工作区是一个文件目录,所有的相关文件都存放在这个目录下,在启动时会有对话框提示选择工作区。
启动以后看到的就是工作台,工作台包含多个透视图,每个透视图又包含多个不同的窗口。
◆Eclipse可以设置文件的关联打开程序,操作方法:Window->Preferences->General->Editors->File Associations.◆Eclipse可以以方法为独立的编辑单位和以类为编辑单位之间进行切换,操作方法:点击按钮[show source of selected Element only]。
◆Eclipse的窗口可以通过点击右上角的标签大小化、恢复的操作,类似于Window的操作。
◆Eclipse中可以实现目录折叠恢复功能,操作方法:点击视图上方的折叠、恢复标签。
◆Eclipse提供了自动刷新功能以避免每次在Eclipse以外更改文件后手工刷新,操作方法:window->Preferences->General->Workspace->选中Refresh automatically。
◆Eclipse中打开一个Java文件,鼠标点击一个元素(类、方法),会在Declarition窗口中直接显示这个元素的源代码,类似于以前的Open Declarition功能(通过Ctrl+鼠标左键)。
另外还可以在Javadoc视图中显示这个元素的javadoc。
◆Eclipse中可以显示行号,操作方法:Window->Preference->General->Editors->TextEditors->选中show line numbers。
使用Eclipse进行Java应用程序开发的入门教程

使用Eclipse进行Java应用程序开发的入门教程第一章:介绍Eclipse和Java开发环境Eclipse是一款流行的集成开发环境(IDE),可用于开发各种编程语言,包括Java。
它提供了强大的工具和功能,使Java开发变得更加高效和便捷。
1.1 Eclipse的安装首先,下载适用于Java开发的Eclipse版本。
安装过程相对简单,按照向导提示顺序执行即可完成。
确保选择Java开发工具(Java Development Tools,JDT)的安装。
1.2 JDK的安装和配置Eclipse需要Java Development Kit(JDK)才能编译和运行Java 代码。
确保已安装最新版本的JDK,并将其配置为Eclipse的默认JDK。
1.3 创建Java项目启动Eclipse后,选择"File -> New -> Java Project"来创建一个新的Java项目。
在弹出的对话框中,输入项目名称并选择所需的JDK版本。
点击"Finish"来创建项目。
第二章:Eclipse的基本功能和工作空间2.1 工作空间Eclipse使用工作空间(Workspace)来组织项目和资源文件。
在启动Eclipse时,会要求选择工作空间文件夹。
一个工作空间可以包含多个项目。
2.2 项目资源Eclipse的"Package Explorer"窗口显示项目中的所有文件和文件夹。
你可以在此窗口中创建、删除和管理项目资源。
2.3 编辑器Eclipse的编辑器是主要的编码区域,用于编写和编辑Java代码。
当你双击项目中的Java文件时,它会在编辑器中打开。
2.4 调试器Eclipse提供强大的调试功能,可帮助你发现和修复代码中的错误。
你可以设置断点、单步执行代码、查看变量的值等。
调试器是开发过程中非常有用的工具。
第三章:Java项目的创建和配置3.1 创建包和类在Eclipse的"Package Explorer"窗口中,右键点击项目,选择"New -> Package"来创建一个包。
eclipse官方使用教程翻译

Eclipse 官方教程Lars vogelVersion 2.3Copyright © 2007 - 2011 Lars Vogel11.11.2011Eclipse java ide本教程java ide eclipse的用法,涉及到eclipse的安装,java程序的创建和使用eclipse的细节,教程基于eclipse3.7(indigo)1. eclipse概览很多人知道eclipse是一个java ide。
Eclipse由开源软件社区创建,并且应用于很多不同的领域,比如作为java或者android的开发环境。
Eclipse工程由eclipse基金会管理,eclipse基金会是一个掌管eclipse工程而且帮助培养开源社区以及一个完整的包含产品和服务的非盈利性并由成员支持的公司。
Eclipse起源于2001年,今天在java开发环境市场占有率达到了65%。
Eclipse能够由各种插件来扩展,因此有很多开源工程和公司通过插件扩展了eclipse,所以使用eclipse也可以开发(eclipse rcp)2开始2.1安装Eclipse需要安装安装java运行时。
我推荐使用java 7(就是java1.7)。
安装eclipse需要从/downloads下载包“eclipse ide for java developers”。
并将它解压到一个目录中,使用的目录名不能包含空格,有时候eclipse出现问题就是因为这个。
解压完了之后就可以使用了,不需要什么额外的安装过程。
2.2开始使用eclipse启动eclipse需要双击eclipse.exe(windows),或./eclipse(linux\mac)。
系统会提示你指定一个workspace。
Workspace是用来存储java工程(关于workspace,后面有详细讲解)。
选择一个空目录然后点击OK,如图:Eclipse会启动然后显示出欢迎页面,点击叉可以关闭欢迎界面,3.eclipse用户界面概览eclipse提供了Perspectives,Views,还有editors,views和editors从属于perspectives。
Ubuntu_下使用Eclipse_CDT开发C、C++简易教程

一、预备工作 1.安装 Java 开发环境(Eclipse CDT 运行必须环境):
sudo apt-get install sun-java6-jdk sudo apt-get install sun-java6-jre
2.安装 C++开发环境 sudo apt-get install g++
由于本工程无命令行参数,所以不需要进行任何设置,点击Close按钮即可。 (3)Debug 点击菜单Run->Debug或使用快捷键F11进行调试,调试过程中使用快捷键F5进行逐步
调试。
结尾语
由于时间仓促,只完成了C语言篇,C++篇类似。如读者需要最新版本,请发E-mail至笔 者gmail:yyhoo2.young@
(3)编写 main.c
点击菜单File->New->Source File新建一个头文件main.c,其内容如下所示:
/* * main.c *
* Created on: 20: young
*/
#include "hello.h"
int main() {
say_hello();
3.下载 Eclipse CDT 进入 Eclipse 官方主页下载页面 /downloads/,找到如下图所 示 Eclipse ID for C/C++ Developers:
选择 Linux 32bit(如果读者安装的是 64bit 的 Ubuntu,请选择后者),进行下载。
当然程序不是一编写完毕,就可以通过编译的,需要调试。
(1)设置断点 选中main.c页面,将鼠标放在该页面的左边框上,点击鼠标右键,弹出菜单,选择 Toggle Breakpoint选项,如下图所示:
Eclipse使用方法介绍

(1)Eclipse启动后,弹出一个【工作空间启动程序】对话框,在【工作空间】文本框中输入“D:\java”目录,单击【确定】按钮。
工作空间workspace用于保存Eclipse所建立的程序项目和相关的设置。
(2)单击【确定】按钮,系统将出现Eclipse的欢迎界面,其中包含【概述】、【教程】、【样本】、【新增内容】以及工作台相关按钮和菜单栏等。
在Eclipse的欢迎界面中,单击【工作台】按钮或者关闭【欢迎】的界面窗口,将显示出Eclipse的工作台,包括标题栏、菜单栏、工具栏、编辑器、透视图和相关的视图。
3.Eclipse菜单栏(1)文件菜单包含【新建】、【保存】、【关闭】以及【刷新】等命令,主要用于新项目的创建、保存以及关闭等操作。
(2)编辑菜单主要用于辅助程序设计代码设计工作、如代码的【复制】、【剪贴】和【粘贴】等。
(3)源代码菜单包含的命令都是和代码编写相关的,主要用于复制编程工作。
(4)重构菜单是Eclipse最为关键的菜单,主要包括对项目重构的相关命令,需重点掌握。
(5)项目菜单用于管理Eclipse中的项目,用于项目的打开与关闭、自动构建等操作。
(6)运行菜单包含了与程序运行和调试相关的各种操作,同时还具有保存运行和调试的记录功能。
(7)窗口菜单用于显示、隐藏或处理Eclipse中的各种视图和透视图。
4.Eclipse中创建Java项目在Eclipse中编写应用程序时,需要先创建一个项目。
Eclipse的多种项目中,其中Java 项目是用于管理和编写Java程序的。
(1)创建一个java项目(2)新建一个类文件5.在代码编辑器中编写并运行Java程序代码编辑器的使用技巧(1)自动导入程序中用到的类:Ctrl+Shift+O(2)自动补全代码:Alt+/Alt + / 具有代码提示、自动补全的功能能够帮助我们在开发的时候,如果忘了某个类的全名,只需要输入开头的几个字母,然后用alt+/出来就可以了,帮助实现快速开发的。
JDK环境配置和eclipse的基本使用教程(包括调试)

第一次实验报告/**@Author:李日中@Data:2012-9-8*/操作系统:Windows XPJDK版本:jdk-7u6-windows-i586.exe集成开发环境(IDE):eclipse-SDK-4.2-win32JDK下载网址:/technetwork/java/javase/downloads/index.html Eclipse下载网址:/downloads/(选择Eclipse Classic 4.2)DOS(字符界面)编程的环境变量配置:1、右击我的电脑——选择属性——选择高级——点击环境变量;2、在Administrator的用户环境变量中(1)新建path(不区分大小写),输入.;D:\Java\jdk1.7.0_06;D:\Java\jdk1.7.0_06\bin;D:\Java\jre7\bin;如图:(2)新建classpath(不区分大小写),输入.;D:\Java\jdk1.7.0_06\lib\dt.jar;D:\Java\jdk1.7.0_06\lib\tools.jar如图:(3)新建java_home,输入.;D:\Java\jdk1.7.0_06;如图:说明:1、(3)步骤不是必须的,因为(1)(2)步骤中我采取了绝对路径;2、变量的命名是不区分大小写的;3、配置完环境变量后,有的机器需要重新启动,看情况。
3、DOS界面的编程(1)基础知识1、dos界面下,是不区分大小写,但区分中英文符号,路径可以是中文,也可以是英文,不过建议全英文,因为dos的debug状态下,中文可能会乱码;2、目录切换的基本命令如:输入cmd,Enter 后输入D:如图:Enter后的结果,如图:再输入cd D:\JA V A培训\javaDOS (注意cd后有空格),Enter后的结果,如图:(2)DOS界面下建立、编译、翻译执行JA V A Application,1、如:在D:\JA V A培训\javaDOS目录下,新建一个文本文件,重命名为InnerClass.java注意去掉“隐藏已知文件类型的拓展名”前面的钩,如图:3、使用UltraEdit打开该文件,输入代码如下:class Outer{private int num = 100;//内置类可以访问private的,public,protected肯定可以class Inner //定义内置类{private int num = 90;void output(){int num = 80;System.out.println(num);//局部变量System.out.println(this.num);//内置类私有成员System.out.println(Outer.this.num);//引用外部类中的私有成员}}class InnerForTest{}class InnerTest{}void output(){Inner inner = new Inner();inner.output();//外部类成员函数调用内部类成员函数}Inner GetInner(){return new Inner();}}class InnerClass{public static void main(String[] args){Outer outer = new Outer();outer.output();//outer.output().inner.output(); //能使用在外部类一个成员函数中已经定义好的内置类对象?}}然后保存,在dos界面下,输入javac InnerClass.java,按下回车键,如图所示:你会发现,什么也没输出,这就对了。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
打开eclipse
第一次使用界面可能是这样的
将它关掉
成为这个样子
新建个工程
一般我们用两类工程:一个是java工程一个是web工程;我们现在建的是java工程:
点右键
选择new 选择project
选择java project Next
输入项目的名字Finish
提示是否打开
Yes
Ok 项目建成了名字为test
下面建一个类
在src 下面点右键New
选class
输入类的名字
将main 选择
Finish
public class test {
/**
*@param args
*/
public static void main(String[] args) { //在这里写代码
}
}
写个一个非常简单的代码
public class test {
/**
*@param args
*/
public static void main(String[] args) { //在这里写代码
System.out.println("你好");// }
}
下面是加的代码
System.out.println("你好");
怎么运行呢
点右键
选择Run as
选择java applications
运行结果如下
在这里打出来字了。