Tuesday, 31 January 2012

Introducing Quercus, a Java-based PHP framework

Quercus is a new approach to authoring Web services and applications using a mixture of Java™ technology and PHP. With the Quercus framework, Java and PHP are integrated with each other, thus allowing you to conveniently incorporate versatile Java libraries like Spring and Hibernate into applications.

Read the full article on the IBM website.

While I am finding out what I can about Quercus it seems to be the PHP engine driving PHP in Liferay.
It seems to be held in the JAR files quercus.jar, resin-util.jar, and javamail-141.jar.

The php.ini file is used to configure the PHP behavior, like setting directories, file paths, changing sessions, and so on. This file can be specified in the web.xml file.
SOme thing like this:

<init-param>
 <param-name>ini-file</param-name>
       <param-value>WEB-INF/php.ini</param-value>
</init-param>


If this is associated with the QuercusServlet, I do not know.

Disabling the Public & Private Pages feature in Liferay

When you log into a Liferay portal you get a menu on the Dock Bar (at the head of the page) which allows you to create Public and private pages.

Sometimes you want to turn this feature off.
Add to your portal-ext.properties file the following settings and restart your portal.
For the tomcat bundle, you need to create it in: {install directory}/liferay-{version}/tomcat-{version}/webapps/ROOT/WEB-INF/classes/portal-ext.properties.

When you have found the file add:

#
# Disabling user private and public pages
#

layout.user.private.layouts.enabled=false
layout.user.private.layouts.modifiable=false
layout.user.private.layouts.auto.create=false

layout.user.public.layouts.enabled=false
layout.user.public.layouts.modifiable=false
layout.user.public.layouts.auto.create=false

This is taken from this post on the Liferay Forum.
See here for details on common Portal properties.

Thursday, 26 January 2012

What process is using that port?

CurrPorts from Nirsoft
Ever wondered which process is using the port you are intrested in?
While a swift "netstat -an" will give you a list of open ports it will not tell you which one is attached to which process.
So try the hard way.... 
Or Microsoft's Port Reporter...

Or the easy way with a small freeware Utility called CurrPorts from Nirsoft that displays all open ports on windows.

Download CurrPorts to your computer:
32Bit version: http://www.nirsoft.net/utils/cports.zip
64Bit version: http://www.nirsoft.net/utils/cports-x64.zip
Unpack the .zip file and double click on the file cports.exe to start CurrPorts. The application will show you a list of all open ports and offers the ability to apply filters on the list.

Thanks to faqforge.com for this gem.

Setting up Eclipse check list (Part 6) - PHP Web development with Tomcat

If you like Xdebug, please consider a donation.
At this point we have to ensure that we have PHP running fine in Tomcat.
  1. Create a new JSP Project called jsp-php.
    Give it a site folder called /webroot.
  2. Give it an index.html file and run the site up to see if it works. (which it should).
  3. Now create it a file (& folder) called /jsp/default.jsp which should have some thing like:

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"
        import="java.util.Date"
        %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
            <link href='http://fonts.googleapis.com/css?family=Cuprum' rel='stylesheet' type='text/css'>
            <link href="../basic.css"  rel="stylesheet" type="text/css" media="screen" />
            <title>Insert title here</title>
        </head>
        <body>
            <h1>New JSP Page</h1>
            <%
            Date now = new Date();
            %>
            Now = <%=now.toString() %>
        </body>
    </html>


    in it.

    Test it to make sure you haven't f****d up Tomcat.
  4. Now create a file (&folder called) /php/index.php which should have something like this:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
            <link href='http://fonts.googleapis.com/css?family=Cuprum' rel='stylesheet' type='text/css'>
            <link href="../basic.css"  rel="stylesheet" type="text/css" media="screen" />
            <title>Insert title here</title>
        </head>
        <body>
            <h1>New PHP Page</h1>
    <p><a href="phpinfo.php">PHP Info</a></p>
    <?php        
            $brush_price = 5;
           
            echo "<table border=\"1\" align=\"center\">";
            echo "<tr><th>Quantity</th>";
            echo "<th>Price</th></tr>";
            for ( $counter = 10; $counter <= 100; $counter += 10) {
                echo "<tr><td>";
                echo $counter;
                echo "</td><td>";
                echo $brush_price * $counter;
                echo "</td></tr>";
            }
            echo "</table>";
    ?>
        </body>
    </html>


    Give it a run and check it works.
  5. Now create a phpinfo.php page.
    Browse to it and ensure you have the correct PHP server and ini file in use.
    Look out for the Zend logo at the bottom.
  6. Assuming this is fine and JSP & PHP both run now we need to set up debugging.
    This is done initially by adding the following options to the top of your php.ini file:

    [PHP]

    ; XDEBUG
    zend_extension = C:\development\php\php_5.3.9\ext\php_xdebug-2.1.2-5.3-vc9.dll
    ; Adding these lines will stop you debugging when calling Eclipse/PHP/Run as php script
    xdebug.default_enable=On
    xdebug.remote_enable=On
    xdebug.remote_host=127.0.0.1
    xdebug.remote_port=9000;
    xdebug.remote_handler="dbgp";
    xdebug.remote_autostart=off


    Now it is possible that all these parts need to be in a [xdebug] section but the jury is still out on that one.
    Please note that from this point onwards this php.ini is useless for "run as script".


    For more on these options go to http://xdebug.org/docs/remote.

    Be extra careful with xdebug.remote_host, this is the host where you develop and run your Eclipse, and PHP will try and connect to Eclipse when debugging is enabled.

    Also make sure that the zend_extension part was not added automatically by the installation, if it was don't add it again.

    If there is any mention of the Zend debugger in you php.ini file, you will have to comment that out.

    Restart Tomcat or whatever web server you're using and make sure the Xdebug installation was correct by running a simple PHP script that contains phpinfo() and searching for "xdebug".
  7. Now the tricky part, Eclipse has to be configured to accept debugging sessions from XDebug.



    Follow the steps below:

    1. Open your project in Eclipse(With PDT installed);
    2. In the main menu select Project->Properties;
    3. On the left side of the window select "PHP Debug" and then click on "Configure Workspace Settings"
    4. On the "PHP Debugger" dropdown select Xdebug and click "Apply";
    5. Click "Configure" to the right of Xdebug in the same window.
    6. Select Xdebug and click "Configure".
    7. On the "Accept remote session(JIT)" select "any" and click "OK". This is extremely important and this is where most people get stuck.

    That's it, Eclipse is now configured.

    Your PHP Preferences should look like this:

    Please note the PHP Executable  is set.
    If it isn't the debugging ISN'T going to work.
    If you choose the incorrect debugger, your project might not execute at all or could execute, but not stop at breakpoints.
    If nothing appears in your drop list it is probably because Eclipse is attempting to help you.
    Only PHP executables that are compatible with your selected PHP Debugger appear in this drop list. Select the correct one and the list populates (/facepalm).
  8. You should be able to invoke debug as... --> PHP Script on any of the scripts.
  9. Now all we need is to be able to be in control of our debugging sessions.
    To do this you have to tell the IDE that you are attempting to connect to it.
    The comms works something like this:



    To connect to the IDE/debugger is to add an option to the URL as follows: "http://localhost/jsp-php/php/index.php?XDEBUG_SESSION_STOP_NO_EXEC=ECLIPSE_DBGP&KEY=13275950773634"

    The absolutely vital part of this is the ?XDEBUG_SESSION_START=ECLIPSE_DBGP parameter.

    An easy (and reliable) way to get this to work if to invoke debug as... --> PHP Web Page. This is by far the best way to proceed as it helps eclipse know which PHP maps to which URL.

    Make sure you have [_] Open in Browser un-ticked so that it invokes your default web browser.
    When you do so it will show the following to you...

    The file I am invoking is phpinfo.php and it appears as http://localhost/jsp-php/webroot/php/phpinfo.php which is not quite right. In this case it is http://localhost/jsp-php/php/phpinfo.php clicking OK will show the script and if you have a break point set then it appears.
    I believe this gets round the problem of the path of the file not being what we need it to be.
    The URL that appears in the browser is ... http://localhost/jsp-php/php/phpinfo.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=13282801757752

    It is also importat NOT to have two copies of eclipse running at once as they will both be listening on the same port! Obvious when pointed out but that doesn't stop you doing it.

    For this we will need to install a Firefox extension called "easy Xdebug"(yes Firefox, you're not developing PHP in IE are you?).
    The easiest way to set this up is using a Firefox Plugin called "Easy XDebug".
    When installed you will find a little icon on the foot of each page.

    But turning it on is not obvious. Go to Firefox;alt;View-->Toolbars-->Addons Toolbar.
  10. Now put a break point in your file.
  11. Click the little bug icon and refresh the page.
    The icon changes as follows:
  12. Step through the code with coding and variable fun and goodness;
  13. Click the icon to turn it off.
    Please not it won't work for other browsers just the one you are in.
 And that's it JSP/PHP & Tomcat in one neat package.


<<Back  | Next>>

Install and configure PHP on your machine

This might seem like an easy thing to do but you would not believe the issues I have had while setting up PHP on a 64bit W7 machine.
The intention is to run it under Tomcat as detailed elsewhere, so this is a non standard install which I also want to be able to debug through eclipse.
The steps are as follows:
  1. Down load the correct version of PHP.
    I went with the Thread safe 5.3.9 version.
    I'm not sure if that was the right choice but I followed the advice listed here. My thoughts were that I want apache/tomcat to handle multiple threads so I expected PHP to do the same.
    Note the debug pack seems to be related to creating stack traces when PHP crashes.
  2. During the install it asks where to install, I wanted to keep it out of the program files directory so I placed it in "C:\development\php\php_5.3.9\".
  3. During the install it asks for the web server set up.
    As Tomcat is not present and I have no Apache or ISS I opted for the Other CGI version.
    (I am not sure at this point if that is causing problems later with debugging).
  4. After the install you should be able to open a command prompt and check every thing is working.
    Simply type php -i  and this will dump the PHP info to screen.
    Running a PHP script is now as simple as "php myfile.php". 
  5. For the next step create a dump of this info:
    php -i > phpinfo.txt
  6. As I want to debug PHPs I need more software XDebug to be exact.
    (There is an other debugger called Zend which looks nice but it is a commercial package and I can't get it at this time.)
    So where do you go to get XDebug ... http://xdebug.org/find-binary.php.
    Take the captured output (phpinfo.txt) and post it to the form on the above page.
  7. Now follow its instructions.
    It should tells you which dll to download (plus a link) and where to put it (the /ext folder) and what to place into the php.ini file.
    Mine ended up looking like this:

    [PHP]
    ; XDEBUG
    zend_extension = C:\development\php\php_5.3.9\ext\php_xdebug-2.1.2-5.3-vc9.dll

    And you can check it is a loaded module by typing php -m which will dump the following:

    ...
    tidy

    tokenizer
    wddx
    xdebug
    xml
    xmlreader
    xmlrpc
    xmlwriter
    zip
    zlib
    [Zend Modules]
    Xdebug
  8. To confirm the set up redo steps 4 and 5 and you should get the message "You're already running the latest Xdebug version".
So far so good!

You now have PHP and its debugger installed.
Now on to gettng it to work within eclipse>>.

PHP running in Tomcat

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.

  1. Don't forget to Install and configure PHP on your machine or it won't work at all - duh!;
  2. From the JavaBridge Project add JavaBridge.jar, php-script.jar and php-servlet.jar to to the <tomcat home>/lib folder. (Do not be tempted to placed them in the ext folder as it will not work).
  3. Edit the <tomcat-home>/conf/web.xml file as follows:

        <filter>
            <filter-name>PhpCGIFilter</filter-name>
            <filter-class>php.java.servlet.PhpCGIFilter</filter-class>
        </filter>
        <!--
        <filter-mapping>
            <filter-name>PhpCGIFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
        -->
        <!-- the following adds the JSR223 listener. Remove it if you don't want to use the JSR223 API -->
        <listener>
            <listener-class>php.java.servlet.ContextLoaderListener</listener-class>
        </listener>

        <!-- the back end for external (console, Apache/IIS-) PHP scripts; remove it if you don't need this -->
        <servlet>
            <servlet-name>PhpJavaServlet</servlet-name>
            <servlet-class>php.java.servlet.PhpJavaServlet</servlet-class>
        </servlet>

        <!-- runs PHP scripts in this web app; remove it if you don't need this -->
        <servlet>
            <servlet-name>PhpCGIServlet</servlet-name>
            <servlet-class>php.java.servlet.fastcgi.FastCGIServlet</servlet-class>
            <load-on-startup>0</load-on-startup>
        </servlet>
       
        <servlet-mapping>
            <servlet-name>PhpJavaServlet</servlet-name>
            <url-pattern>*.phpjavabridge</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>PhpCGIServlet</servlet-name>
            <url-pattern>*.php</url-pattern>
        </servlet-mapping>


    And at the end of the file:
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
            <welcome-file>index.htm</welcome-file>
            <welcome-file>index.jsp</welcome-file>
            <welcome-file>index.php</welcome-file>
        </welcome-file-list>


  4. Create a new Tomcat project;
  5. Add a index.php file with this contents:

    <?php phpinfo();?>

  6. Start the server up and browse to it.
An alternate is to use Quercus which is a Java implementation of PHP which apparently supports the DBGp protocol which would be great for use with Liferay as it has the Quercus servlet as its default method of supporting PHP. The only problem is finding out how to debug the thing!!!

    Wednesday, 25 January 2012

    Setting up Eclipse check list (Part 5) - PHP development

    By this point you will have most of what you need set up.
    This post deals with PHP development.
    First make sure you have PHP set up.

    Follow the steps the professionals give you or my short hand a good PDF is located here or even this one.
    1. Install the PHP Development tools in eclipse.
      This is done under Eclipse-->Help-->Install New Software...;
      Select from the Work with drop down "Indigo - http://download.eclipse.org/releases/indigo"
      then enter PHP in the "filter with type", which should give you the PDT tools as follows:

      #1 Install the PHP Development tools in eclipse.
      Make sure you get a version above PDT 2.2 as it is very buggy.
    2. You may also need these extra bits (I didn't).
       
    3. At this point you have a PHP Perspective in eclipse but the IDE is not set up.
      Running a PHP file will give this error:
    4. So next you need to set up a few PHP settings under Eclipse-->Window-->Preferences; PHP -->Path Variables add  PHP-HOME which points to your PHP instalation (mine is C:/development/php/php_5.3.9) which was set up earlier.
    5. Next create a PHP executable environment under the PHP preferences.
      In mine I called it php-5.3.9 and set the executable path to "C:\development\php\php_5.3.9\php.exe". Also set up the path to the PHP.ini file.
      Within the same window set up the PHP Debugger as XDebug and the type as CGI.
      Mine was called PHP-5-3-9 (XDEBUG) and is defined as the workspace default.
    6. You should now be able to set up a PHP project and create a PHP file to dump the info.
      Some thing like this:
      <?php phpinfo();?>
      Select the php file and perform a (rightclick)-->Run As..-->PHP Script, the result should be largely the same as the output from php -i.
    7. Now lets attempt to do some debugging;
      Enter this script into a file called list.php:

      <?php
      $brush_price = 5;

      echo "Quantity\tPrice";
      for ( $counter = 10; $counter <= 100; $counter += 10) {
          echo "\n";
          echo $counter;
          echo "\t\t";
          echo $brush_price * $counter;
      }
      echo "\n";


      Running it should give a two column result ... easy.
      Now try to debug it (rightclick)-->Debug As..-->PHP Script.
      This should give the same result, so put a break point on one of the echo commands.
      This will give you the eclipse dialog box asking wheter you should open the debug perspective.
      Say yes then happy debugging.
      If nothing happens then you have probably not got the correct version of PHP setup.

    The next objective is to get the PHP running in Tomcat and break points set up.



    <<Back  | Next>>

    Monday, 23 January 2012

    LIferay - new liferay project "Failed while installing Liferay Portlet 6.0"

    While attempting to create my first Liferay project I found my self facing an error.
    "Failed while installing Liferay Portlet 6.0. Most of the project seemed to be present but there were missing xml files and a missing icon. Being dumb and keen I perservered. The portlet would deploy but nothing worker right.
    So having deleted everything I came in on the monday morning to start again.
    A quick bit of research shows the following:
    • Installing Eclipe for Java developers does not include the web development tools;
      So a dynamic web site will not work;
    • Installing the Liferay IDE plugin fetches you the latest version of the tools which allows a dynamic web site 2.x to 3.0;

    When a dynamic web project  is created, various information is assembled to specify the type of project, add standard libraries, set compiler options, control publishing tasks, set the build path and/or add an annotation processor. This information is specified by choosing facets during project creation. Facets can also be added and deleted from a project after its initial creation. To edit a project's facets, select Project > Properties > Project Facets.
    Facets have version numbers. Not all facet version numbers can be changed (e.g., a facet available in only one version of software can not have other version numbers). Some facet version numbers are inter-dependent (e.g., if you choose the facet Java Annotation Processing, you must also have Java version 5.0 selected since Java versions 1.3 and 1.4 did not support annotation processing).
    Doing some more research I discovered that the version number was related to the Servlet API version. A snippet from Wikipedia: http://en.wikipedia.org/wiki/Java_Servlet


    Servlet 3.0December 2009JavaEE 6, JavaSE 6Pluggability, Ease of development, Async Servlet, Security, File Uploading
    Servlet 2.5September 2005JavaEE 5, JavaSE 5Requires JavaSE 5, supports annotations
    Servlet 2.4November 2003J2EE 1.4, J2SE 1.3web.xml

    Tomcat 7 will support 2.2 and 3.0 (See ...) and if you attempt to create a standard dynamic web project everything goes fine.
    So what to do .....

    While creating your project click the Advance project configuration... button link.


    After selecting this option select a lower version of the servlet protocol. Postings on the Liferay forum seem to indicate that 2.5 and 3.0 do not work.So choose 2.4 ...

    This seems to work a treat!

    Setting up Eclipse check list (Part 4) - More Plugins

    Having got your main plugins installed lets move on to some minor usefull ones.

    Log4e

    Log4E is an Eclipse Plugin which helps you to use your logger easily in Java Projects.
    The Plugin Log4E is not bound to any special logging framework. Thus you might be able to adapt to your own logger by defining your own templates using the preferences. It has active support for Log4j, Commons Logging and JDK 1.4 logging.
    Go to http://log4e.jayefem.de/content/view/3/2/ and either down load the pro or the free version.
    The ZIP file contains a features & plugins folder, just drop them into your eclipse folder.

    StartExplorer Eclipse Plug-in

    Every now and then when working with Eclipse you'd like to examine a file or a folder inside the Eclipse workspace with your file manager or open a shell/cmd.exe in this location. Or you edit a file in Eclipse and would like to open the parent folder of this file in the file manager or shell. Or the file you are editing contains a string which references another file in the filesystem and you would like to do some of the things mentioned above with that referenced file. This plug-in gives you a convenient way to do all this by adding a few entries to Eclipse's context menus.

    Just drag-and-drop the button to the Eclipse menu bar to install the plug-in:

    <<Back  | Next>>

    Friday, 20 January 2012

    Setting up Eclipse check list (Part 2) - Java Preferences (java-code-cleanup.xml)

    Article

    
    
    
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <profiles version="2">
    <profile kind="CleanUpProfile" name="Embed Code Clean-up Profile" version="2">
    <setting id="cleanup.format_source_code" value="true"/>
    <setting id="cleanup.add_missing_annotations" value="true"/>
    <setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/>
    <setting id="cleanup.remove_unused_private_types" value="true"/>
    <setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
    <setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="true"/>
    <setting id="cleanup.add_generated_serial_version_id" value="false"/>
    <setting id="cleanup.make_variable_declarations_final" value="true"/>
    <setting id="cleanup.add_missing_methods" value="true"/>
    <setting id="cleanup.always_use_this_for_non_static_field_access" value="true"/>
    <setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/>
    <setting id="cleanup.correct_indentation" value="true"/>
    <setting id="cleanup.never_use_parentheses_in_expressions" value="false"/>
    <setting id="cleanup.add_serial_version_id" value="true"/>
    <setting id="cleanup.remove_unused_private_methods" value="true"/>
    <setting id="cleanup.use_this_for_non_static_field_access" value="true"/>
    <setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/>
    <setting id="cleanup.remove_unused_private_members" value="false"/>
    <setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/>
    <setting id="cleanup.remove_trailing_whitespaces_all" value="true"/>
    <setting id="cleanup.make_type_abstract_if_missing_method" value="false"/>
    <setting id="cleanup.always_use_this_for_non_static_method_access" value="false"/>
    <setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>
    <setting id="cleanup.format_source_code_changes_only" value="false"/>
    <setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/>
    <setting id="cleanup.add_missing_nls_tags" value="false"/>
    <setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="false"/>
    <setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/>
    <setting id="cleanup.remove_unnecessary_casts" value="true"/>
    <setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
    <setting id="cleanup.use_parentheses_in_expressions" value="true"/>
    <setting id="cleanup.remove_unused_private_fields" value="true"/>
    <setting id="cleanup.make_parameters_final" value="true"/>
    <setting id="cleanup.remove_trailing_whitespaces" value="true"/>
    <setting id="cleanup.remove_unused_imports" value="true"/>
    <setting id="cleanup.organize_imports" value="true"/>
    <setting id="cleanup.sort_members" value="false"/>
    <setting id="cleanup.remove_private_constructors" value="true"/>
    <setting id="cleanup.convert_to_enhanced_for_loop" value="true"/>
    <setting id="cleanup.always_use_blocks" value="true"/>
    <setting id="cleanup.never_use_blocks" value="false"/>
    <setting id="cleanup.always_use_parentheses_in_expressions" value="true"/>
    <setting id="cleanup.use_this_for_non_static_method_access" value="false"/>
    <setting id="cleanup.remove_unused_local_variables" value="false"/>
    <setting id="cleanup.make_private_fields_final" value="true"/>
    <setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
    <setting id="cleanup.add_default_serial_version_id" value="true"/>
    <setting id="cleanup.sort_members_all" value="false"/>
    <setting id="cleanup.use_blocks" value="true"/>
    <setting id="cleanup.add_missing_override_annotations" value="true"/>
    <setting id="cleanup.make_local_variable_final" value="true"/>
    </profile>
    </profiles>
    
    
    
    

    Installing and setting up Liferay on Tomcat 7

    Liferay is distriuted under a LGPL licence.

    Author used Tomcat 7.0.23  & Liferay 6.1.0
    This is an abreviated version of a very usefull article on installing LifeRay into an existing Tomcat container. (See...)
    • Ensure Tomcat already runs and has no other webapps;
    • Install the Liferay Dependencies bundle in your Tomcat installation (See...);
      There are three JARs and they go in tomcat-x.x.x/lib/ext.If you do not have the ext directory, create one. This folder is for JARs that are loaded by the Bootstrap class loader.
    • Add " Java transaction manager " jta.jar (Available here; download class files and rename the ZIP file jta.jar.) (Software License Agreement);
    • Add mail.jar (Available here; located in root of the downloaded ZIP file.) (JavaMail License Agreement);
    • Delete all the contents in /ROOT;
    • Move the files from the .war to the now empty ROOT folder. The simplest way to do this is to open it with an archiver program such as 7zip or WinRAR, then copy/extract all of the files into ROOT. 
    • Add a file version.txt to the folder as a reminder of the version of LifeRay in use.
      ie. "liferay-portal-6.1.0-ce-ga1-20120106155615760"
    • Edit the file and add the line
      set "JAVA_OPTS=%JAVA_OPTS% -Xmx1024m -XX:MaxPermSize=256m"
      
      Somewhere near the top.;
    • Inside eclipse change the VM tomcat settings for the Sysdeo plugin.
      This is under Window-->Tomcat-->JVM Settings [Append to JVM Parameters][Add]...
      -Xmx1024m 
      -XX:MaxPermSize=256m
    Which may not work at this time as there do not seem to be enough JARs in the ext folder.

    OR
    • This version comes with data and a set of plugins which appear as webapps;
    • Start up Tomcat and the start up triggers a browser window titled "Basic Configuration";
    • Set the portal name;
    • Set the default language to English (UK);
    • Don't forget to set up the admin user;
    • Finish the configuration;
    • The configuration will be stored in a file called portal-setup-wizard.properties located at the same level as the tomcat server folder;
    • Click Goto my Portal and see the portal;
    • Shut down tomcat and edit the tomcat server.xml  file change "<Connector port="8080"" to "<Connector port="80"";
    • Re-start tomcat to check the new port;
    • Next we need to set up the email client.Liferay's default configuration looks for a mail server on the same machine on which Liferay's running, and it tries to send mail via SMTP to this server. If this is not your configuration, you'll need to modify Liferay's defaults. To do this, you'll use a portal-ext.properties file.
      The file that is used to override the configuration is portal-ext.properties. This file should be created in your Liferay Home folder.

    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)

    Setting up Eclipse check list (Part 2) - Java Preferences (Codeconverntions.xml)

    See original article

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <profiles version="12">
    <profile kind="CodeFormatterProfile" name="Java Conventions [Embed]" version="12">
    <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line_shifted"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
    <setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="8"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
    <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
    <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_shifted"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_shifted"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line_shifted"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line_shifted"/>
    <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
    <setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
    <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line_shifted"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
    <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
    <setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
    <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
    <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
    <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
    <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
    <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="true"/>
    </profile>
    </profiles>