分类: LINUX
2011-09-11 18:13:59
How to install Eclipse in Ubuntu.
Parent page:
Including Eclipse , Apache Tomcat, Sun's JDK and icons.
Install packages
In Edgy (Ubuntu 6.10) and newer most of these packages are now available through apt-get (or your preferred package manager like Synaptic or Adept) from the universe and multiverse repositories. It is recommended that you use the installation from Ubuntu's repositories when available. See for notes on installing packages in Ubuntu.
Eclipse
See for instructions installing and setting up Eclipse.
Sun's Java JDK
You can install the Sun Microsystems JDK either by installing from the Ubuntu repositories or via a more manual process of downloading and creating your own packages. Before Dapper, Ubuntu 6.06, Sun's licenses were not not compatible with Ubuntu's repositories and therefore had to be separately downloaded. From Dapper there are packages in the multiverse repository. This howto creates a .deb package from a download. For Ubuntu 5.10 Breezy Badger users (and earlier), manual download and setup is the only option.
Install from Repository
See for instructions installing the Sun JDK via the repositories.
Install by Building your own Package (Ubuntu 5.10 and older)
, which currently is Mustang, 1.6. Choose the latest jdk update, and then choose the self extracting non rpm file, eg. jdk-6u4-linux-i586.bin
Install fakeroot and java-package from universe to be able to repackage the jdk as a .deb.
Once that is done we create the .deb jdk package.
fakeroot make-jpkg jdk-6uxxx-linux-i586.binSome interaction is required, and there will be the odd permission error etc, but should be fine.
Then we install this new package
sudo dpkg -i sun-j2sdk1.6xxx+updatexxx_i386.debMake Sun's Java your java...
sudo update-alternatives --config javaChoose the Sun JDK
Apache Tomcat
You can choose to install Apache from the Ubuntu repositories or go a more manual route, setting it up yourself.
Install from Repositories
Install the tomcat5.5 tomcat5.5-admin and tomcat5.5-webapps packages. See for details.
Install Manually
If you chose not to install from the Ubuntu repositories and wish to install Apache Tomcat manually, fetch the latest apache tomcat binary. Choose the core tar.gz file.
Untar download and copy to /opt
sudo tar zxfp apache-tomcat-5.5.15.tar.gz -C /optEdit tomcat users
sudoedit /opt/tomcat/conf/tomcat-users.xmlAnd add an admin and your own?
Eclipse Web Tools Project (WTP)
Once you have Eclipse up and running the WTP can be installed using Eclipse's own "Software Updates" mechanism: Go to "Help -> Software Updates -> Find and Install", select the "Callisto Discovery Site" and later the "Web and J2EE development" plugin group. Click "Select required" to automatically select all the dependencies.
You might want to install to "/usr/local/lib/eclipse" to make the plugins available for other users.
Add Projects
Follow this tutorial to create web projects and to add tomcat as the server for this project,
The Tomcat publishing is bothersome if your project structure is not a particular standard. have started a document on how to set up your projects.
Notes
Method for older Ubuntu versions
The manual installation sections are based on a howto by and information gathered from many references. As the old university excuse goes: "Copy from one source is plagiarism, copy from two or more is research".
Note: don't follow he's installation method. Prefere this one:
sudo tar xzpf ARCHIVE -C /optLater, you can create the .desktop thing as indicated.
Method for newer Ubuntu versions
Help > Software Updates > Find and Install... > (*) Search for new features > Next > [x] Europa Discovery Site >
PTD runs on the top of WST therefore you have to install WST first - Expand WEB and JEE development and choose WST You will get and error of the same nature you godt before don't mind - Just click on select required (the error will disapear) -Click finish
Now go back and repeate the same procedure for PTD (when get the error just click on select required)
References
Ivar Abrahamsen's original howto
Java
Eclipse
Web Tools
Eclipse Callisto
Ubuntu Eclipse
Apache Tomcat
How to create generic projects in Eclipse