Setting Up Liferay IDE
Now that you have Liferay IDE installed, either from a downloaded zip file or from the update site appropriate for your Eclipse version, you need to perform some basic setup. This section describes the setup steps to perform so you can develop your Liferay portal and test your customizations.
Before setting up Liferay IDE, let’s make sure you have all the appropriate software packages installed.
Before setting up Liferay IDE, you need to have appropriate versions of Liferay Portal, Liferay Plugins SDK and/or Maven, and Eclipse. Make sure you satisfy these requirements before proceeding:
Liferay Portal 6.0.5 or greater is downloaded and unzipped
Liferay Plugins SDK 6.0.5 or greater is downloaded and unzipped, and/or any version of Maven is installed. If you’re using the Plugins SDK, make sure the Plugins SDK version matches the Liferay Portal version.
You’ve installed an appropriate Eclipse IDE version for Java EE Development, and the Liferay IDE extension–see the Installation section if you haven’t already done this.
Note: Earlier versions of Liferay (e.g., 5.2.x) are not supported by Liferay IDE.
Let’s set up your Liferay Plugins SDK.
Registering the Liferay Plugins SDK with Liferay IDE
Before you begin creating new Liferay plugin projects, a supported Liferay Plugins SDK and/or Maven installation and Liferay Portal must be installed and configured in your Liferay IDE. If you’re thinking, “Wait a second, buster! I thought the Plugins SDK and Maven could be used without Liferay IDE!”, then you’re right. In the The Plugins SDK chapter, we’ll explain how to use the Plugins SDK on its own, with a text editor. Also, we’ll explain how to use Maven on its own in the Developing plugins using Maven chapter. Here, we explain the easiest way to use the Plugins SDK: by running it from Liferay IDE.
In Eclipse, click Window → Preferences → Liferay → Installed Plugin SDKs.
Click Add to bring up the Add SDK Dialog.
Browse to your Plugins SDK installation. The default name is the directory name; you can change it if you want.
Select OK and verify that your SDK was added to the list of Installed Liferay Plugin SDKs.
Note: You can have Multiple SDKs in your preferences. Set one as the default SDK by checking its box in the list of Installed Liferay Plugin SDKs.
Let’s set up your Liferay Portal Tomcat runtime and server.
Liferay Portal Tomcat Runtime and Server Setup
In Eclipse, go to Window → Preferences → Server → Runtime Environments.
Figure 10.2: Choosing a runtime environment
Click Add to add a new Liferay runtime; find Liferay v6.1 (Tomcat 7) under the Liferay, Inc. category and click Next.
Click Browse and select your
If you’ve selected the Liferay portal directory and a bundle JRE is present, it is automatically selected as the server’s launch JRE. If no JRE bundle is present, then you must select the JRE to use for launch by clicking Installed JREs….
Figure 10.3: Choosing the JRE bundle
Click Finish; you should see your Liferay portal runtime listed in Preferences → Server → Runtime Environments.
Click OK to save your runtime preferences.
If you haven’t created a server, create one now from the Servers view in Liferay IDE; then you can test the server.
Figure 10.4: Adding a runtime to the Servers view
Scroll to the Liferay, Inc folder and select Liferay v6… Server. Choose the Liferay v6… runtime environment that you just created.
Now your server is set up. Let’s launch it and perform some tests!