Create Combined Java/Flex project in Flex Builder
April 23, 2008 – 6:37 amOne of the new features in Flex Builder 3 is that you can create a combined Java/Flex project. This feature was added to help developers who code on both server side and client side parts for a project. Also it really helps development by keeping all code together for a specific project and also there is no need for multiple IDEs, like Eclipse + Flex Builder or NetBeans + Flex Builder.
We will create not only a combined Java/Flex project but a LCDS (LiveCycle Data Services) enabled project. Prerequisite for this would be an already installed server (we will go with Tomcat) that you will need to use when creating an LCDS project.
First of all you will need the Web Tools Platform (WTP) plugin installed. To install it go to Help > Software Updates > Find and Install, select “Search for new features to install” and click Next. Click on “New Remote Site”, insert a name for the site (ex. WTP) and in the URL input insert “http://download.eclipse.org/webtools/updates/”. Click on and the new remote site should be listed on the “Sites to be included in search”. Select the site and click Finish. The list of site mirrors will appear, select one of them and click OK. After the search is complete select all features to be installed. You should have something like this:

Click Next, accept the Feature License and proceed to install. After install is complete restart Flex Builder and hopefully all is ok.
Next step is to setup the Server in Flex Builder. For that we will need the Servers View. Get that from Window > Other Views and from the list select the Server > Servers View. In that view right-click and select New > Server. From the list select the appropriate server you have installed, select the Server Runtime and click Finish.
Now its time for Project Setup.
In the “New Flex Project” form select Web Application from Application Type and J2EE for Application Server Type on Server Technology. Also select “Use remote object access service” and “LiveCycle Data Services” within it and also “Create combined Java/Flex project using WTP”. Java source folder will be set to “java-src”. You should have something like this:

Click next and “Configure J2EE Server” form will appear. In J2EE settings select the server for Target Runtime, context root and content folder are loaded by default with the project name and “WebContent” and for the Flex WAR file you will need to browse to the location where LiveCycle Data Services is installed and select lcds.war.
Click Finish and the project should be created. Inside it you have “Java Resources: java-src” for all java sources, flex_libs for .swc files, flex_src for flex sources and also WebContent folder keeping all files needed for deployment. If you browse into WebContent/WEB-INF/flex you should see the LCDS configuration xml files.
You can run the project on server by selecting Run as > Run On Server. From the form select the server you installed and click Finish. The project should then start on local server without any problems.
All you need to do now is start coding on both sides and configure LCDS just as you did before, the only difference is that you do them all in one place. Nice.