|
11 years ago 26 |
Eclipse is a platform that has been designed from the ground up for building integrated web and application development tooling. By design, the platform does not provide a great deal of end user functionality by itself. The value of the platform is what it encourages: rapid development of integrated features based on a plug-in model.
Eclipse provides a common user interface (UI) model for working with tools. It is designed to run on multiple operating systems while providing robust integration with each underlying OS. Plug-ins can program to the Eclipse portable APIs and run unchanged on any of the supported operating systems.
At the core of Eclipse is an architecture for dynamic discovery, loading, and running of plug-ins. The platform handles the logistics of finding and running the right code. The platform UI provides a standard user navigation model. Each plug-in can then focus on doing a small number of tasks well. What kinds of tasks? Defining, testing, animating, publishing, compiling, debugging, diagramming...the only limit is your imagination.
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.
Often, programmers fall in love with Python because of the increased productivity it provides. Since there is no compilation step, the edit-test-debug cycle is incredibly fast. Debugging Python programs is easy: a bug or bad input will never cause a segmentation fault. Instead, when the interpreter discovers an error, it raises an exception. When the program doesn't catch the exception, the interpreter prints a stack trace. A source level debugger allows inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective power. On the other hand, often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective.
This tutorial will explain how to install Eclipse 3.7, Python 3.2 and the Python plugin (PyDev) for Eclipse.
First open your Software Manager from Menu Other Software Manager and type in the search box "eclipse" without quotes and click on eclipse.
Now press the button install
Finally to launch Eclipse go to Menu Programming Eclipse
If for some reason you couldn't install Eclipse 3.7 indigo from Software Manager follow the following steps.
First you need to download Eclipse for 32bit or 64bit system. In my case I downloaded the 64bit version.
Once you download the file locate it and extract it. I assume that the downloaded file is located in /home/Downloads. Open a terminal with Ctrl+Alt+T and type
cd ~/Downloads (With this command we change the default directory "/" to "/Downloads") and then type
For 32bit version
tar xvf eclipse-SDK-3.7.2-linux-gtk.tar.gz to extract the file.
For 64bit version
tar xvf eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz to extract the file.
Opt is reserved for additional software you install. This is kind of like ‘Program Files‘ for linux.
Once you extract the file type the following commands invidually:
sudo mv eclipse /opt/
cd /opt
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
To do this execute the following commands:
sudo touch /usr/bin/eclipse
sudo chmod 775 /usr/bin/eclipse
Now press Alt+F2 and type:
gksu gedit /usr/bin/eclipse
and copy paste the below code:
#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"
$ECLIPSE_HOME/eclipse $*
and finally save the file.
To create a menu icon press Alt+F2 and type:
gksu gedit /usr/share/applications/eclipse.desktop
and copy paste the below code:
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
Press Alt+F2 and type:
/opt/eclipse/eclipse -clean &
You can download Python from here.
Once you download the file locate it and extract it. I assume that the downloaded file is located in /home/Downloads. Open a terminal with Ctrl+Alt+T and type
cd ~/Downloads (With this command we change the default directory "/" to "/Downloads")
tar xzf Python-3.2.3.tgz to extract the file.
In the terminal type the following commands invidually:
cd Python-3.2.3
./configure
make
make test
sudo make install
Note: It will take some time, especially the command "make test".
Now we have Python 3.2 on our computer.
PyDev is a Python IDE for Eclipse, which may be used in Python, Jython and IronPython development.
First open Eclipse and go to Help Install New Software...
In Work with: type PyDev - http://pydev.org/updates and press tha button Add... Then check the first option PyDev and click Next
And the installation will begin.
When you see the Selection Needed dialog box, you must manually check the box before pressing okay. If you do not, it appears that the installation is continuing, but it is not. You must uninstall PyDev, then reinstall.
And finally restart Eclipse
Go to Window Preferences. In the Preferences window, expand PyDev and select Interpreter-Python.
Click "New..." and type Python32 for the Interpreter name. For the Interpreter executable, browse to your copy of Python /usr/local/bin/python3.2, and press Open.
Click "OK" and the Selection Needed Window will appear.
Select all but the PySrc and python32.zip and click OK as many times as necessary to exit the preferences.
The default selection should be fine. The Interpreter is now set up so that the code you write can be interpreted for the computer to run. You are now ready to start running code.
Select File New Project. Select Pydev Pydev Project.
Create a new project with the name "HelloWorld". Select Python version 3.0 and your interpreter Python32.Also check Create 'src' folder and add it to the PYTHONPATH?.
Press Finish.
Select Window Open Perspective Other. Select the PyDev perspective.
Select the "src" folder of your project, right-click it and select New PyDev Modul. Create a module "FirstApp".
Type in the source code print("hello World!")
From your menu find the Play button your model and select Run As Python run.
You will see Hello World in your console.
Perfect and thanks. This is also working for newest version of python, "Neon".
Good tutorial. Just a couple of minor points of slight confusion.
1) In a Mint install, the path for the interpreter executable is /usr/bin and not /usr/local/bin
2) Under eclipse 3.8.1, the 'Run as' from the main menu doesn't display the options as displayed above. However, right clicking does.
thanks... it's a very good tutorial!
Thanks man, very good tutorial.
Good Work Pal.
Noble of tutorials! Thx!
Thank you everyone
I completely agree with @Alexio .
All of the tutorials which have been created by @efthialex are models of tutorial.
Very useful, thank you! This tutorial should be an example to follow for all the tutorial authors.
Wonderful tutorial!
Fantastic tutorial.
Great job!
@prjolivet
Thanks for the hint.
Yes great looking tutorial.I think it would be more simple to install Eclipse 3.7 from the mint repository (available on Lisa).
Great looking tutorial :)