个人工具

“UbuntuHelp:EclipseWebTools”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的5个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/EclipseWebTools}}
 
{{From|https://help.ubuntu.com/community/EclipseWebTools}}
 
{{Languages|UbuntuHelp:EclipseWebTools}}
 
{{Languages|UbuntuHelp:EclipseWebTools}}
== Eclipse Web Tools ==
+
'''How to install Eclipse in Ubuntu'''.
'''How to install Eclipse in Ubuntu'''.  
+
Parent page: [[UbuntuHelp:EclipseIDE| Eclipse IDE]]
Including Web tools, Apache Tomcat, Sun's JDK and icons
+
Including Eclipse [http://www.eclipse.org/webtools/ Web Tools Project], Apache Tomcat, Sun's JDK and icons.
=== Convenient way for Ubuntu 6.10 ===
+
In Edgy (Ubuntu 6.10) most of the packages are now available through apt-get (or your preferred package manager like Synaptic or Adept) from the universe and multiverse repositories. Install the packages '''eclipse, sun-java5-jre and tomcat5.5'''.
+
Use the "'''update-java-alternatives'''" command to make sure that Sun's Java is the default.
+
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.
+
See below for details on Tomcat setup and Eclipse / Tomcat integration.
+
=== Method for older Ubuntu versions ===
+
This is based on a howto by IvarAbrahamsen 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".
+
Ubuntu does come with many eclipse packages in the universal repositories.  Unfortunately (or not) these all rely on the GCJ compiler, and not the genuine Sun one.  Many still prefer Sun's java and this howto show how to use it.
+
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.
+
=== Download software ===
+
====  Sun JDK ====
+
If you chose not to use the ''sun-java5'' package in multiverse, then download the latest JDK from Sun., which currenly is Tiger, 1.5. Choose the latest jdk update, and then choose the self extracting non rpm file, eg. jdk-1_5_0_06-linux-i586.bin
+
http://java.sun.com/j2se/1.5.0/download.jsp
+
==== Eclipse Web Tools ====
+
Download the latest release of web tools from eclipse.
+
I use the full package of release 1.0. E.g. wtp-all-in-one-sdk-1.0.2-linux-gtk.tar.gz.
+
(Ps. its about 170Mb so might take awhile depending of bandwidth.)
+
http://download.eclipse.org/webtools/downloads/
+
==== Apache Tomcat ====
+
Fetch the latest apache tomcat binary.
+
Choose the core tar.gz file.
+
http://tomcat.apache.org/download-55.cgi
+
 
=== Install packages ===
 
=== Install packages ===
See [[UbuntuHelp:InstallingSoftware|InstallingSoftware]].
+
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 [[UbuntuHelp:InstallingSoftware|InstallingSoftware]] for notes on installing packages in Ubuntu.
 +
==== Eclipse ====
 +
See [[UbuntuHelp:EclipseIDE| Eclipse IDE]] for instructions installing and setting up Eclipse.
 
==== Sun's Java JDK ====
 
==== Sun's Java JDK ====
Either install from the repository or download and create your own packages. For Breezy users (and earlier), download is the only option.
+
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 =====
 
===== Install from Repository =====
Install the <code><nowiki>sun-java5</nowiki></code> package from <code><nowiki>multiverse</nowiki></code>.
+
See [[UbuntuHelp:EclipseIDE| Eclipse IDE]] for instructions installing the Sun JDK via the repositories.
===== Download =====
+
===== Install by Building your own Package (Ubuntu 5.10 and older) =====
 +
[http://java.sun.com/javase/downloads/index.jsp Download the latest JDK from Sun], 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 <code><nowiki>fakeroot</nowiki></code> and <code><nowiki>java-package</nowiki></code> from <code><nowiki>universe</nowiki></code> to be able to repackage the jdk as a <code><nowiki>.deb</nowiki></code>.
 
Install <code><nowiki>fakeroot</nowiki></code> and <code><nowiki>java-package</nowiki></code> from <code><nowiki>universe</nowiki></code> to be able to repackage the jdk as a <code><nowiki>.deb</nowiki></code>.
 
Once that is done we create the <code><nowiki>.deb</nowiki></code> jdk package.
 
Once that is done we create the <code><nowiki>.deb</nowiki></code> jdk package.
 
<pre><nowiki>
 
<pre><nowiki>
fakeroot make-jpkg jdk-1_5_xxxx-linux-i586.bin
+
fakeroot make-jpkg jdk-6uxxx-linux-i586.bin
 
</nowiki></pre>
 
</nowiki></pre>
 
Some interaction is required, and there will be the odd permission error etc, but should be fine.
 
Some interaction is required, and there will be the odd permission error etc, but should be fine.
 
Then we install this new package
 
Then we install this new package
 
<pre><nowiki>
 
<pre><nowiki>
sudo dpkg -i sun-j2sdk1.5xxxx+updatexxx_i386.deb
+
sudo dpkg -i sun-j2sdk1.6xxx+updatexxx_i386.deb
 
</nowiki></pre>
 
</nowiki></pre>
 
Make Sun's Java your java...
 
Make Sun's Java your java...
第50行: 第30行:
 
Choose the Sun JDK
 
Choose the Sun JDK
 
==== Apache Tomcat ====
 
==== 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 <code><nowiki>tomcat5.5</nowiki></code> <code><nowiki>tomcat5.5-admin</nowiki></code> and <code><nowiki>tomcat5.5-webapps</nowiki></code> packages. See [[UbuntuHelp:ApacheTomcat5| Apache Tomcat 5]] 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.
 +
http://tomcat.apache.org/download-55.cgi
 
Untar download and copy to /opt
 
Untar download and copy to /opt
 
<pre><nowiki>
 
<pre><nowiki>
tar xzf apache-tomcat-5.5.15.tar.gz
+
sudo tar zxfp apache-tomcat-5.5.15.tar.gz -C /opt
sudo mv apache-tomcat-5.5.15 /opt/
+
 
cd /opt
 
cd /opt
sudo chown -R root:root apache-tomcat-5.5.15
 
sudo chmod -R +r apache-tomcat-5.5.15
 
sudo chmod +x `sudo find apache-tomcat-5.5.15 -type d`
 
 
sudo ln -s apache-tomcat-5.5.15 tomcat
 
sudo ln -s apache-tomcat-5.5.15 tomcat
 
</nowiki></pre>
 
</nowiki></pre>
第69行: 第52行:
 
<user name="yourname" password="blah" roles="manager,admin" />
 
<user name="yourname" password="blah" roles="manager,admin" />
 
</nowiki></pre>
 
</nowiki></pre>
==== Eclipse ====
+
==== Eclipse Web Tools Project (WTP) ====
Extract the eclipse download and move to opt.
+
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.
<pre><nowiki>
+
You might want to install to "/usr/local/lib/eclipse" to make the plugins available for other users.
tar xzf wtp-all-in-one-sdk-1.0-linux-gtk.tar.gz
+
sudo mv eclipse /opt/eclipse cd /opt sudo chown -R root:root eclipse
+
sudo chmod -R +r eclipse
+
sudo chmod +x `sudo find eclipse -type d`
+
</nowiki></pre>
+
Then create an eclipse executable in your path
+
<pre><nowiki>
+
sudo touch /usr/bin/eclipse
+
sudo chmod 755 /usr/bin/eclipse
+
sudoedit /usr/bin/eclipse
+
</nowiki></pre>
+
With this contents
+
<pre><nowiki>
+
#!/bin/sh
+
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
+
export ECLIPSE_HOME="/opt/eclipse"
+
 
+
$ECLIPSE_HOME/eclipse $*
+
</nowiki></pre>
+
Then create a gnome menu item
+
<pre><nowiki>
+
sudoedit /usr/share/applications/eclipse.desktop
+
</nowiki></pre>
+
With this contents
+
<pre><nowiki>
+
[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
+
</nowiki></pre>
+
In dapper you have to give a bit of a kick to pick up the new folder in the menu.
+
Open ''Applications/Accessories/Alacarte Menu Editor'',
+
Go to ''Programming'' and click on Eclipse to hide then again to make it visible.
+
This should make the folder show up in the menu.
+
=== Finished ===
+
You now have a working eclipse. But run this command first to initialise the set up.
+
<pre><nowiki>
+
/opt/eclipse/eclipse -clean
+
</nowiki></pre>
+
Then from here on you can run from the menu item applications/programming/eclipse
+
 
=== Add Projects ===
 
=== Add Projects ===
 
Follow this tutorial to create web projects and to add tomcat as the server for this project, [http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html]
 
Follow this tutorial to create web projects and to add tomcat as the server for this project, [http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html]
 
The Tomcat publishing is bothersome if your project structure is not a particular standard. IvarAbrahamsen have started a document on how to set up your projects. [http://flurdy.com/docs/eclipse/project.html]
 
The Tomcat publishing is bothersome if your project structure is not a particular standard. IvarAbrahamsen have started a document on how to set up your projects. [http://flurdy.com/docs/eclipse/project.html]
=== References ===
+
=== Notes ===
 +
==== Method for older Ubuntu versions ====
 +
The manual installation sections are based on a howto by IvarAbrahamsen 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:
 +
<pre><nowiki>
 +
sudo tar xzpf ARCHIVE -C /opt
 +
sudo ln -s /opt/eclipse/eclipse /usr/local/bin
 +
</nowiki></pre>
 +
Later, 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 http://flurdy.com/docs/eclipse/install.html
 
* Ivar Abrahamsen's original howto http://flurdy.com/docs/eclipse/install.html
 
* Java http://java.sun.com
 
* Java http://java.sun.com
第134行: 第90行:
 
* How to create generic projects in Eclipse http://flurdy.com/docs/eclipse/project.html
 
* How to create generic projects in Eclipse http://flurdy.com/docs/eclipse/project.html
 
----
 
----
[[category:CategoryDocumentation]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年11月17日 (二) 18:58的最新版本

How to install Eclipse in Ubuntu. Parent page: Eclipse IDE Including Eclipse Web Tools Project, 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 InstallingSoftware for notes on installing packages in Ubuntu.

Eclipse

See Eclipse IDE 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 Eclipse IDE for instructions installing the Sun JDK via the repositories.

Install by Building your own Package (Ubuntu 5.10 and older)

Download the latest JDK from Sun, 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.bin

Some 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.deb

Make Sun's Java your java...

sudo update-alternatives --config java

Choose 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 Apache Tomcat 5 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. http://tomcat.apache.org/download-55.cgi Untar download and copy to /opt

sudo tar zxfp apache-tomcat-5.5.15.tar.gz -C /opt
cd /opt
sudo ln -s apache-tomcat-5.5.15 tomcat

Edit tomcat users

sudoedit /opt/tomcat/conf/tomcat-users.xml

And add an admin and your own?

<user name="admin" password="admin" roles="manager,admin" />
<user name="yourname" password="blah" roles="manager,admin" />

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, [1] The Tomcat publishing is bothersome if your project structure is not a particular standard. IvarAbrahamsen have started a document on how to set up your projects. [2]

Notes

Method for older Ubuntu versions

The manual installation sections are based on a howto by IvarAbrahamsen 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 /opt
sudo ln -s /opt/eclipse/eclipse /usr/local/bin

Later, 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