Friday, 20 January 2012

Setting up Eclipse check list (Part 3) - Plugins

Plugins are probably very personal to what you are doing.
My set is for:
  • Java Development;
  • JSP tomcat development;
  • PHP development;
  • Webpage development;
  • Portal development; 
I have installed the plugins in the following order:

JSP tomcat development
  1. Download Sysdeo Eclipse Tomcat Launcher plugin.
    Version 3.3 seems best.
    Just follow their isntructions which basicly means unzip into - Eclipse_Home/dropins;
    Add the DevloaderTomcat7.jar to the <tomcat home>/lib folder. (Do not be tempted to placed them in the ext folder as it will not work).
    On restart you should see the tomcat icons:

    Under Windows-->Preferences; Tomcat point the Tomcat Home to your desired version of tomcat.
    Under Windows-->Preferences; Tomcat set up "Contect declaration mode" to be Context files as this prevents all the messy editing of a single server.xml file;
    Under Windows-->Preferences; Tomcat-->JVM Settings point the JVM to your desired version JRE. I suggest that this is set to be the JDK you installed earlier.
    Test the whole thing with a Java project containing a dummy bean class;
    Create a web project with a JSP that targets the bean;
    Link the projects;
    Set up the devloader's paths under "Project"-->Properties ; Tomcat-->DevLoader Classpath;
    A nice article is here in case my short-hand check list is too breif.
PHP development
It is fun to have PHP running in Tomcat and not too hard to achieve. Especially if you follow the instructions at PHP/Java Bridge or even here.
My notes on this are located here.
  1. Don't forget to Install and configure PHP on your machine or it won't work at all - duh!;
  2. Set up Tomcat to serve PHP by default.
  3. Create a new Tomcat project;
  4. Add a index.php file with this contents:

    <?php phpinfo();?>

  5. Start the server up and browse to it you should get the PHP info as a HTML page.
  6. Next setup debugging. This is detailed in the later post (here...)
Setting up PHP under Tomcat can be relatively straight forwards. However at some point you are going to want to run some form of web CMS. My current suggestion is ModX. (See...)

Portal development
I am doing portal development with Liferay so first you need to down load the Portlet SDK from their down load site.
A full set of install & configuration options are available on the LifeRay IDE setup pages or follow my short hand.
  1.  Down load the Liferay including tomcat and set it up as a stand-a-lone Tomcat instance (Liferay 6.1.0 contains tomcat 7.0.23).
    I don't know if it will run PHP out of the box more to add later.
    And the Sysdeo Devloader
    I installed my life ray to C:\development\java\tomcat\liferay-portal-6.1.0;
  2. Create a new eclipse workspace to preserve all the raw Tomcat setings and reconfigure with <liferay-portal-home>/tomcat-7.0.23 as your tomcat-home location;
    Don't forget to import all your Java preferences!
  3. Add under Windows-->Preferences; Tomcat-->JVM Settings

    -XX:MaxPermSize=512m
    -Xmx2048m

  4. Test your Liferay portal starts in Eclipse;
    (Start up time can be amlost 2mins 12000ms);
  5. Install the SDK
    Pick the latest comunity version of the Portlet SDK. Mine went into my java libs folder (C:\development\java\libs\liferay\6.1.0). Next add the Liferay IDE via the eclipse plugin installer which is under Help-->Install New Software ; Add. button to open Add Site dialog.Type in "Liferay IDE" for name and use the Indigo release stable URL - http://releases.liferay.com/tools/ide/eclipse/indigo/stable/.
    This comes with a large number of IDE dependencies so it is a good one to install after Sysdeo.
    If it has loaded correctly then it should add icons to your eclipse toolbar.
  6. Under Windows-->Preferences;Liferay -->Installed Plugin SDKs add the installed SDK (Mine is in :\development\java\libs\liferay\6.1.0);
  7. Under Windows-->Preferences;Liferay; Create a new Runtime environment  and choose "Liferay v6.1 CE (Tomcat 7)" ;
    Which in turn will want to know where tomcat is, (ie. C:\development\java\tomcat\liferay-portal-6.1.0\tomcat-7.0.23);
    This seems to add the correct libs when creating an addin. (???)
  8. Follow through and add a server configuration to handle this set up;
    Or it seems that the test packages will not operate correctly as there must be a target runtime to link to.




(Prev - Java preferences)

2 comments:

  1. I have been following your blog while trying to set up Eclipse as my IDE for PHP portlet development under Liferay CE, in order to avoid hacking things via Notepad++ as I currently do. Being new to both Liferay and Java, this is turning out to be a minor challenge as there doesn't appear to be an immediately available plugin. Did you ever manage to achieve this ?

    Robin, South Africa
    rmartin at dstpims dot co dot za

    ReplyDelete
    Replies
    1. Life ray is not necessary for PHP to work with Tomcat.
      It is possible to get PHP running under Tomcat independently as adding LifeRay can complicate things beyond what you may need for a simple website. However if you follow my posts regarding getting the PHPBridge set up, then a portlet to run PHO within Tomcat is relatively straight forwards.
      Since I posted this I have dropped Liferay in favour of the much smaller Portal frame work Pluto.

      I will however post up the PHP Portlet I wrote while creating this post.

      Delete