1. Installing Oracle Java SE 6
Ubuntu installations (and possibly other distributions of Linux) have OpenJDK installed by default. The latest version of the Java SE 6 JDK can be obtained from Oracle's Java downloads page:
http://www.oracle.com/technetwork/java/javase/downloads/index.htmlOnce you have downloaded the JDK (i.e. jdk-6u39-linux-i586.bin), make the bin executable, execute it to unpack the files in the current directory and move the unpacked directory (i.e jdk1.6.0_39) to /usr/lib/jvm/:
Now use the update-alternatives utillity to install and select (via the config switch) the default versions of Java:
Test that Java is executable from shell by checking the version:
2. Installing Eclipse IDE and Plugins
2.1. Eclipse
First download the JavaEE version of the Eclipse IDE from the download site: http://www.eclipse.org/downloads/.
NOTE: on Ubuntu 12.04 I recommend using Eclipse Indigo (3.7) for JavaEE Developers (obtained from the Indigo download site). Updgrading to Juno (4.2) on Ubuntu causes my Eclipse to become very slow and unresponsive at times (see the following bug report) so I am using the older version until the issue is resolved. Also, this does not affect Eclipse Juno on Windows 7 which I have been able to run without problems.
Create the eclipse group and add the current user along with any other users who should have permissions to run Eclipse and install plugins to the new group:
Log out and log in again with the current user to update the groups. Next, extract the downloaded eclipse tar archive (i.e. eclipse-jee-indigo-SR2-linux-gtk.tar.gz) to the current directory, move the extracted directory to /opt/
and change ownership of the directory to the user root and group eclipse:
Create a desktop file and place it into /usr/share/applications
and copy the following to the eclipse.desktop file:
2.2. Subclipse Plugin
Install the subversion and maven packages via the apt-get utillity in a terminal window:
To install the subclipse plugin, start Eclipse by clicking on the icon in the launcher (under the Development category), select a workspace and select Install New Software... from the Help menu.
Copy and paste the update site URL http://subclipse.tigris.org/update_1.6.x
into the text area labeled Work with and click the Add button.
Enter the name Subclipse 1.6.x
, click OK and select all of the items in the list: Core SVNKit Library, Optional JNA Library, and Subclipse
.
Click the Next button twice, agree to the license agreement terms and click Finish to install the plugin. Click Restart Now when Eclipse prompts you to restart.
Once restarted, configure the plugin in Eclipse by selecting Preferences from the Window menu and selecting Team > SVN from the list on the left (you might get an error about the JavaHL Library at this point which you may ignore for now).
On the SVN preferences page select the SVNKit option from the SVN interface dropdown and click OK (JavaHL does not seem to work as well and can sometimes cause errors).
2.3. M2e Plugin
To install the Maven plugin for Eclipse select Install New Software... from the Help menu, copy/paste the m2e plugin update site URL http://download.eclipse.org/technology/m2e/releases
into the text area labeled Work with and click the Add button.
Enter a name for the site, such as "m2e", click OK and select the Maven Integration for Eclipse item from the list. Click the Next button twice, agree to the license agreement terms and click Finish to install the plugin. Click Restart Now when Eclipse prompts you to restart.
Confirm that the Oracle JDK (and not the OpenJDK) is selected/added to the list of installed JREs in Eclipse by selecting Preferences from the Windows menu and selecting the Java > Installed JREs item from the list on the left. You should see jdk1.6.0_39
checked off in the list.
NOTE: If you do not see the Oracle JDK in the list click the Add... button, select Standard VM
from the list, click Next and enter the path to the jre home (i.e. /usr/lib/jvm/jdk1.6.0_39/
) before clicking Finish. Make sure that this is the default selection before continuing.