Basic Setup Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission from Liferay, Inc.
Objectives Basic Setup 1. Install Java 2. Install Liferay/Tomcat bundle
Why use Tomcat? Tomcat is the fastest server for development of the extension environment. Use Tomcat for development even if you will use a different server for production. Then deploy your code to the other server for periodic testing. Changing servers is easy! Just change the app.server.type. For example, app.server.type=tomcat app.server.type=websphere
Tomcat Requirements Java will need to be installed and JAVA_HOME will need to set in order for Tomcat to run. What’s JAVA_HOME? JAVA_HOME is an Environment Variable. You will need to point it to the directory where you installed your JDK. Note: We will go over how to set JAVA_HOME later in the presentation.
Uninstall Previous Versions of Java We will be using J2SE 5.0 jdk-1_5_0_08-windows-i586-p.exe It is highly recommended that you uninstall all previous versions of Java even if you need it for another project. Java is easy to install, and you can always reinstall the version of Java that you need after the training session is over. Errors that occur from having multiple versions of Java will cause delays for the entire class.
Install Java 1.First let’s create a folder where we will install all Java-related tools: C:\Java 2.Next install J2SE 5.0. Double click jdk-1_5_0_08-windows-i586-p.exe 3.See the next slide for further instructions.
1.Install J2SE 5.0 to C:\Java\jdk1.5.0_08\ instead of C:\Program Files\Java\jdk1.5.0_08\ (See below.) 1.Click Next until the installation has finished. C:\Java\jdk1.5.0_08
1.Right click My Computer and click Properties Advanced Environment Variables 2.Under System Variables click New Make sure you click New under System variables NOT User variables 3.Variable name: JAVA_HOME Variable value: C:\Java\jdk1.5.0_08 Set JAVA_HOME C:\Java\jdk1.5.0_08
Checkpoint Verify that JAVA_HOME is correct. C:\Java\jdk1.5.0_08
1.Under System Variables click Path then Edit 2.Type %JAVA_HOME%\bin; at the beginning of the Path 3.Don’t forget the semi-colon at the end! Example: %JAVA_HOME%\bin;%SystemRoot%\system 32;%SystemRoot%;%SystemRoot%\System32 \Wbem;C:\Program Files\ATI Technologies\ATI Control Panel; Add JAVA_HOME to the Path
1.Click Start Run… 2.Type cmd and press Enter 3.Type path 4.Make sure that C:\Java\jdk1.5.0_08 is in the Path! 5.Make sure that there is only ONE JDK in your path! Checkpoint
Unzip Tomcat 1.Create the following directory structure: C:\Training\liferay\tomcat 2.Locate the Liferay-Tomcat bundle on CD: liferay-portal-tomcat-jdk zip 3.What’s the Liferay-Tomcat bundle? It’s just Tomcat pre-configured to run Liferay. 4.Unzip Tomcat (liferay-portal-tomcat-jdk zip) to C:\Training\liferay\tomcat
1.Go to C:\Training\liferay\tomcat\bin 2.Double click startup.bat Start up Tomcat
Modify the Console Window Right click the Tomcat menu bar and select Properties
Modify the Console Window 1.Click the Layout tab 2.Screen Buffer Size Width: 100 Height: Window Size Width: 100 Height: 30 1.Click Save properties for future windows with same title
Look at the Console Window! Increasing the window size makes it easier to read the console. Increasing the screen buffer size allows us to see the full error message when an error is thrown. Make it a habit to read what is being displayed in the console even if you do not have an error! By the time we start developing our first portlet, you should know which messages indicate a successful startup and which messages indicate an error. As a developer you MUST learn how to read the console and track down the root cause of an error.
Open up your web browser and type You will automatically be redirected to
Congratulations! Congratulations! You’ve just set up Liferay Portal! Login: Password: test To hot deploy JSR-168 compliant portlets, Liferay layout templates, or Liferay themes just drop your *.war files in C:/home/liferay/deploy Sample portlets can be found here: For more information on hot deploy, click here:
Revision History Edward Shin8/28/2006Updated for Liferay Mark Wong9/12/2006Updated for 4.1.2