MSWL Development & Tool Eclipse IDE Micael Gallego micael.gallego@urjc.es Escuela Técnica Superior de MSWL: Official Master's Program on Libre Ingeniería Informática Software - Development Tools Departamento de Ciencias 1 de la Computación
Eclipse IDE Eclipse is an open source community whose projects are focused on building an extensible development platform, runtimes and application frameworks for building, deploying and managing software across the entire software lifecycle. Many people knows it, and hopefully love it, as a Java IDE but Eclipse is much more than a Java IDE. http://www.eclipse.org 2
3
Eclipse IDE The Eclipse open source community has over 200 open source projects. These projects can be conceptually organized into seven different "pillars" or categories: Enterprise Development Embedded and Device Development Rich Client Platform Rich Internet Applications Application Frameworks Application Lifecycle Management (ALM) Service Oriented Architecture (SOA) 4
Eclipse IDE The Eclipse community is also supported by a large and vibrant ecosystem of major IT solution providers, innovative start-ups, universities and research institutions and individuals that extend, support and complement the Eclipse Platform. We are interested in the Eclipse Integrated Development Environment (IDE) 5
Eclipse IDE 6
Eclipse IDE Eclipse IDE is open source, it has the Eclipse Public License (similar to Mozilla Public License) Is built in Java, and thus is multiplatform The user interface is implemented with Standard Widget Tool (SWT), a library that wraps native platform controls (responsive and integrated UI) Works very well in the main platforms: Win, Linux and Mac 7
Eclipse IDE In this context we are interested in the Eclipse development tools Programming Languages: Java, C/C++, Pascal, Haskell, PHP, PascalFC, ActionScript (Flash), Ada, Groovy, Python, JavaScript, Scala, Linux scripts... Control version systems: CVS, SVN, Git... 8
Eclipse IDE Issue tracker systems: Bugzilla, Trac, GoogleCode, Redmine... Other development tools Tests (JUnit), Continous integration (Hudson, Jenkins), Documentation... 9
10
11
12
13
14
15
Eclipse IDE Other side tools Latex XWiki UML diagrams Database access Web server integration Monitoring, profiling, logging management... 16
Eclipse IDE Eclipse IDE is a modular system All tools are available by means of plugins A plugin is like an addon or complement that can be installed in the Eclipse IDE There are commercial and open source plugins There are official Eclipse plugins and other ones developed by third parties (organizations, companies, individuals...) Of course, Eclipse has their own AppStore http://marketplace.eclipse.org 17
Eclipse IDE Eclipse Distributions Eclipse can be downloaded in pre-configured distributions They are called Eclipse Distros or Eclipse packages Each distro has a set of related plugins to accomplish a certain task (Java development, C/C++ development, web development...) There are fully open source free distros and commercial ones (with commercial plugins) Eclipse has native code (for UI). For this, you have to download the Eclipse distro for your platform 18
Eclipse IDE How to download Eclipse Official Eclipse packages Preferred way to obtain Eclipse http://eclipse.org/downloads/ MyEclipse (Commercial) Advanced commercial plugins http://www.myeclipseide.com/ 19
Eclipse IDE How to download Eclipse EasyEclipse EclipseGavab Discontinued http://www.easyeclipse.org/ Developed in the URJC to first courses students http://www.sidelab.es/projects/eclipsegavab/ Aptana Eclipse distro oriented to Web development http://aptana.com/ 20
21
Eclipse IDE 22
Eclipse IDE The official Eclipse Distros are installed following the following steps: Download and install Java SE Runtime Environment (JRE) All platforms: Oracle JRE from http://www.java.com Linux: OpenJDK from repositories Download Eclipse in.zip or.tar.gz Decompress Eclipse file Eclipse is launched executing eclipse native executable in eclipse folder In linux, the official Oracle Java has no installer, only a tar.gz file. How execute eclipse: Put jre folder inside eclipse folder Edit Environment variables to include java bin in the PATH Edit eclipse.ini file to include the full path to Java JRE 23
Eclipse IDE Eclipse needs a folder to store configuration data This folder is called workspace The workspace path is asked to user every time he launches Eclipse Is recommended to use a different workspace for each different project/context One ws per subject One ws to final master project One ws to experiment with some new language/technology 24
Eclipse IDE When you start Eclipse from a brand new workspace, a Welcome page is shown Is a web page with information about Eclipse and the currently installed plugins 25
Close Welcome page 26
Eclipse IDE The parts in which the window is divided are called views You can rearrange, move, maximize and close views to configure Eclipse to fit your needs 27
Eclipse IDE If you close a view it can be shown again 28
Eclipse IDE Eclipse has several perspectives depending on the task at hand Programming perspectives Debug perspective Control Version systems perspectives SVN repostory exploring, Git, CVS Team synchronizing Other perspectives Java, Java EE, C/C++ XML, JPA, Database... The available perspectives depend on your eclipse distro and the installed plugins 29
30
You can change the current perspective using the toolbar Each perspective has the most suited views oriented to solve a specific task 31
PyDev PyDev is the Eclipse plugin to develop with Python Is being developed by appcelerator, the Aptana company It is not an official Eclipse plugin (but this is not important) Can be used to do Python, Jython and IronPython development It is included in Aptana (Eclipse Distro) It is open source (Eclipse Public License) http://pydev.org/ 32
PyDev It comes with many goodies such as: Django integration Code completion Auto import Syntax highlighting Code analysis Go to definition Refactoring Mark occurrences Debugger Remote debugger Tokens browser Interactive console Unit test integration Code coverage 33
34
PyDev Installation Be sure that python is installed in your system If not, install it :) 35
PyDev Installation (2) Be sure you have an Eclipse distro somewhere in your disk and execute it Try to use a modern version (3.8 or 4.2 Juno) Launch Eclipse with an user with write permissions in the eclipse folder itself (needed to install the plugin) In Eclipse Menu Help > Eclipse Marketplace Type PyDev in Find box and clic on Go button 36
PyDev Installation (3) Do clic on Install button in PyDev Python IDE for Eclipse Go throught dialogs with Yes Next Accept Install Restart or similar options... Be patient... if download fails, restart. 37
PyDev Installation After Eclipse restart, you can open the new PyDev perspective Menu Window > Open Perspective > Other... 38
Source file editor area Project and File explorer Source file members (classes, methods, functions...) Folders are shown like packages in the python sense Source code errors 39
PyDev Configure Python Interpreter in Eclipse After installing it, the first thing you must do is configure the Python interpreter. Menu window > preferences > PyDev > Interpreter Python Try with Auto Config button, that will try to find it in your PATH 40
41
PyDev A Python Program is developed in a Eclipse PyDev Project Menu File > New > PyDev project Select a name for it Clic Finish 42
PyDev You are ready to create python modules (source files) and python packages (folders) Menu File > New > PyDev Module Write Name test_app Clic in Finish button Write the module: print "Hello World!" 43
PyDev Execute a module Launch the program Program Input/output The first time: Menu Run > Run As > Python Run The following times: Clic Green Play toolbar button The Console view appears with the program output Is like a shell Finishing the program The program can be stopped any time with the stop button in the Console view 44
Launch Module Stop the program Console 45
PyDev Execute a module Launch the program Program Input/output The first time: Menu Run > Run As > Python Run The following times: Clic Green Play toolbar button The Console view appears with the program output Is like a shell Finishing the program The program can be stopped any time with the stop button in the Console view 46
PyDev Your code can be debugged with Run > Debug It ask to change to debugger perspective You can... Execute your code step by step Put breakpoints to pause the execution in a certain point Inspect variable values Play with Eclipse and PyDev with python sample code http://wiki.python.org/moin/simpleprograms 47