670 likes | 845 Views
Java Integrated Development Environments: ECLIPSE. Part1. Installation. Eclipse Installation. ■ Detailed Instructions. http://www.3plus4software.de/eclipse/installation_e n.html. ■ Basic Ingredients:. ■ Windows, Linux, Solaris, QNX or Mac OS/X operating system. ■2 56 MB RAM or more.
E N D
Java Integrated Development Environments: ECLIPSE Part1 Installation
Eclipse Installation ■DetailedInstructions http://www.3plus4software.de/eclipse/installation_e n.html ■BasicIngredients: ■Windows,Linux,Solaris,QNXorMacOS/X operating system. ■256 MB RAM or more ■AJava2runtimeenvironment(JRE)orJava2 Software Development Kit (J2SDK). Eclipse needs version 1.3or higher. ■EclipseSDKversion 2.1.3 (thelaststableversion) 200303331 3 Eclipse Installation ■Extract eclipse-SDK-*-*.zip inthepaththatwillnow morebethe%eclipse_home%. An eclipsedirectorywill be created. – E.g. C:\eclipse 200303331 4
Eclipse Installation ■EclipseisaJavaprogram.Youhavetospecifythe Javapath.Therearetwoways: –1st:SpecifytheJavapathinthePATHenvironmentvariable –2nd:CopythejrefolderfromtheJAVA_HOMEdirectorytothe ECLIPSE_HOME directory ■Runeclipse;Clickontheeclipseicon 200303331 5 Eclipse Installation ■Alternative.Runeclipsefromacommandline window specifying the Java path (-vm) ■Givesflexibilityinspecifyingvariousparameters when starting eclipse 200303331 6
Eclipse Installation ■Formoredetailsonrunningeclipsevisitthis: http://help.eclipse.org/help21/index.jsp?topic=/org. eclipse.platform.doc.user/tasks/running_eclipse.htm ■Theeclipsesite http://www.eclipse.org 200303331 7 Part2 Workbench
Workbench 200303331 9 Workbench ■Editors – A visual component within the workbench – Used to edit or browse a resource ■Views – A visual component within the workbench – Used to navigate a hierarchy of information, open an editor or display properties of an active editor ■Perspectives – Groups of views an editors within the workbench 200303331 10
A simple example… editor perspective 200303331 11 views Creating resources ■Threealternatives 1. File menu 2. Navigator context menu (right-click on selected resource) 3. New Wizard button 200303331 12
Creating a new project ■Fromthe menubar,selectFile>New>Project… 200303331 13 Creating a new project 200303331 14
Creating a new project 200303331 15 Creating a new folder ■Fromthepopupmenuofa project in the navigation view, select New > Folder 200303331 16
Creating a new folder 200303331 17 Creating a new file ■Fromthetoolbarusethe “New” Wizard button and select “File” 200303331 18
Creating a new file 200303331 19 Creating a new file 200303331 20
Editors ■Editorsaretiledusingtabs(ifthereismorethan one file opened) ■Theappropriateeditorisusedaccordingtothetype of file 200303331 21 Editors 200303331 22
Editors 200303331 23 Stack editors ■Possiblebothsidebysideandoneabovetheother 200303331 24
Stack editors ■Possiblebothsidebysideandoneabovetheother 200303331 25 Views ■Viewshelpyouworkwithresourcesinadditionto editors 200303331 26
Views (example) ■TheNavigatorviewdisplaystheprojectsandother resources that you are working with Navigator View 200303331 27 Views (example) ■Thebookmarkviewdisplaysallbookmarksinthe workbench along with the name of the file the bookmark is associated Bookmark view 200303331 28
Views ■DisplayviewsfromWindow>ShowViewmenu 200303331 29 Views ■Experimentasmuchasyouwantwiththeviews ■RearrangetheWorkbenchusingthe Window > Reset Perspective menu 200303331 30
Show me the files… ■Q:Wherearemyfilesactuallystored? ■A: 1. Open your file system explorer 2. Navigate to the location where you installed eclipse (%ECLIPSE_HOME%). You will find a sub-directory called “workspace” 3. You will find the projects, folders and files in that sub- directory 200303331 31 Import files 1.DragandDropfilesfromthefilesystem 2.CopyandPastefilesfromthefilesystem 3.Usetheimportwizardeitherfromthepopupmenu of the navigator or from the File menu 200303331 32
Import files 200303331 33 Import files 200303331 34
Import files 200303331 35 Import files 200303331 36
Import files 200303331 37 Link folder to file system ■Ifyoudonotwantthecontentsofthefoldertobe copied in the “workspace” you have to “link” the folder to a position in the file system upon its creation 200303331 38
Link folder to file system 200303331 39 Link folder to file system ■Click “Advanced” ■Check “Linktofolderinfilesystem” ■Browsetofindthedesiredfolder 200303331 40
Link folder to file system 200303331 41 Link folder to file system 200303331 42
Link folder to file system 200303331 43 Link folder to file system ■Ifyousneakinthefilesystemexploreryouwillsee that there is no folder “StamatisLink” in the “workspace” folder. Any change will be automatically made to the resources linked in the file system. 200303331 44
Part3 Java Development Prepare Workbench ■SwitchtoJavaPerspectiveusing Window > Open Perspective > Java Menu 200303331 46
Prepare Workbench 200303331 47 Prepare Workbench ■Javaperspectivehasthefollowingviews – Package Explorer – Hierarchy – Outline – Search – Console – Tasks 200303331 48
Prepare Workbench ■VerifyJREinstallationand classpathvariables ■SelectmenuWindow>Preferences 200303331 49 Prepare Workbench ■SelectJava>Installed JREs ■ConfirmthataJREhasbeenautomaticallydetected. ■TheuseofanSDKratherthanaJREis recommended 200303331 50
Prepare Workbench ■Select “Workbench” ■Makesure “Performbuildautomaticallyonresource modification” is checked 200303331 51 Code Organization ■Projects ■Packages ■Classes 200303331 52
Create a new Java project ■Projectsarethecontainersofpackages ■Alljavaprojectsaredirectlystoredinsideaproject ■GeneratedCLASSfilesarestoredalongwiththe JAVA source files ■Twowaystocreateanewproject 1. From the File > New > Project menu 2. From the “New Java Project” icon in the toolbar 200303331 53 Create a new Java project ■Select “Java”,thenNext 200303331 54
Create a new Java project ■Choosewhetheryouwill “import”contentintheproject. In this case the content is NOT copied in the workspace 200303331 55 Create a new Java project ■Addanyexternaljarsnecessarytorunyourcode (if any) ■Click “Finish” 200303331 56
Create a new Java project 200303331 57 Create a new Java package ■Choosetheprojectthatwillcontainthepackage from the Package Explorer ■Threewaystocreatethenewpackage 1. From the pop-up menu (right-click on the project) select New > Package • From the “File” menu select New > Package • From the toolbar using the “New Package” icon 200303331 58
Create a new Java package ■Giveanametothepackage ■Click “Finish” 200303331 59 Create a new Java package 200303331 60
Create a new Java Class ■TherearevariouswaystocreateanewJavaClass – Select the package where the new class will reside 1. Use “New Class” icon in the workbench toolbar 2. From the package’s pop-up menu (right-click) choose New > Class 3. From the toolbar select the “New” icon’s drop-down and then select “Class” 4. From the toolbar select the “New” icon and then “Java” in the left pane and “Class” in the right pane 5. Select File > New > Class menu ■YoucanalwaystypeanewclassinanexistingJava file from the Package Explorer 200303331 61 Create a new Java Class 200303331 62
Create a new Java Class ■Selectaclassname ■Selectpossible superclass ■Selectpossible implementing interfaces ■e.t.c 200303331 63 Create a new Java Class 200303331 64
Java editor features ■Importassistance 200303331 65 Java editor features ■MethodCompletion(automaticallyorusingCtrl+Space) 200303331 66
Java editor features ■Hoveringoveridentifiershows Javadocspec 200303331 67 Java editor features ■On-the-flyspellcheck Hover over this to see mistake 200303331 68
Java editor features ■QuickFix Double click here to get suggestions 200303331 69 Java editor features ■Codetemplates(Ctrl+Space) 200303331 70
Java editor features ■Argumenthints 200303331 71 Java editor features ■JavaDocAssist 200303331 72
Class Hierarchies 200303331 73 Class Hierarchies 200303331 74
Class Hierarchies 200303331 75 Class Hierarchies 200303331 76
Class Hierarchies 200303331 77 Class Hierarchies ■Selectatypeandfromitspop-upselect “OpenType Hierarchy” ■TheHierarchyViewwillappear 200303331 78
Class Hierarchies 200303331 79 Search for Java Elements ■DeclarationsorReferences 200303331 80
Search for Java Elements 200303331 81 Search for Java Elements ■Selectatypeormethod ■Fromitspop-upselectSearch>References>Workspace ■Youwillretrieveallit’sreferencesintheSearchView 200303331 82
Search for Java Elements Search View 83 Run Java Programs ■Buildisperformedautomaticallyuponresource modification ■Ifyouwanttodoitexplicitlyselectmenu Project>Rebuild project ■Twowaystorunaproject: – Select menu Run > Run As > Java Application – Click on the “Run” icon in the toolbar 200303331 84
Run Java Programs 200303331 85 Run Java Programs ■TheConsoleViewshowsupwiththeoutput! Console View 200303331 86
Part4 UML Eclipse UML Installation ■Exiteclipse ■DownloadEMF(EclipseModelingFramework)zipfile from http://www.omondo.com/download/free/index.jsp ■UnzipEMFzipin%ECLIPSE_HOME%directory ■Re-starteclipse ■Exiteclipse 200303331 88
Download this 200303331 89 Eclipse UML Installation 200303331 90
Eclipse UML Installation ■DownloadEclipseUMLzipfilefrom http://www.omondo.com/download/free/index.jsp ■UnzipEclipseUMLzipin%ECLIPSE_HOME% directory ■Re-starteclipse ■That’sit! ■Moredetailsin: –http://www.omondo.com/faq/free/index.jsp#emfzipi –http://www.lifl.fr/~offroy/eclipse_HTML/internal/instal lation/Eclipse_Java_&_UML_install.html 200303331 91 Download This 200303331 92
Eclipse UML Installation 200303331 93 Create your first class diagram ■Selectapackage ■Fromitcontextmenu(right-click)select New>Other>UML->UML Class Diagram 200303331 94
Create your first class diagram 200303331 95 Create your first class diagram 200303331 96
Create your first class diagram ■Choosethekindof relationship you want to be depicted – Association – Inheritance – Dependency 200303331 97 Create your first class diagram ■Choosetheclassesthatwill participate in the diagram 200303331 98
Create your first class diagram ■Hereisit! 200303331 99 Prepare Workbench for UML design ■SelectmenuWindow>Preferences 200303331 100