Creating a combined Flex/Java project in Flex Builder w/o LCDS/BlazeDS
Whenever I work on a Flex project with Java backend I create a project in Flex Builder that combines Java and Flex. I find that this is the easiest way to work even if I don’t touch at all Java code and I just mess around with Flex/AS files. This is one piece of news brought by Flex Builder 3.
What advantages do you have using this setup? You can edit/run/debug both Java and Flex files in the same editor and same project; you can see the changes as soon as you save the modified files.
Let’s see what you need and how you can create a combined Flex/Java project with or without LiveCycle Data Services or BlazeDS.
Installing WTP (Web Tools Project)
In order to be able to create the combined project you need to have installed WTP (Web Tools Project - this is an open source Eclipse plugin that adds J2EE capabilities into Eclipse). If you start the New Flex Project Wizard and select J2EE from server technology and you don’t see the option “Create combined Java/Flex project using WTP” it means you need to install it.
For this you go to Help > Software Updates > Find and Install… Then select “Search for new features to install” and click Next. You should see something like this (select Europa Discovery Site) :
After this you follow the dialog screens and at some point you will see this screen (you press the “Select Required” button and Next, Next, Next and Finish):
Possible problems installing WTP in Flex Builder: sometimes although you have installed WTP you don’t see the option “Create combined Java/Flex project using WTP”. The solution is simple: type in a console the path to the eclipse executable and add “-clean” option; for my machine this command looks like: “c:\eclipse\eclipse.exe -clean”. After this you should be good to go.
Create the combined Java/Flex project
Let’s open the New Flex Project wizard and select from “Application server type” combo-box “J2EE” and make sure that the option “Create combined Java/Flex project using WTP” is checked (check the first image from this post if you need help). If you want to create a project that is using LCDS (LiveCycle Data Services) or BlazeDS you need to check “Use remote object access service”. Click “Next” and you see this page:
In the second page of the wizard you need to pay attention to “Target runtime”. WTP has a wonderful feature: you can configure your local J2EE server using a simple wizard and then Eclipse can deploy your application and can start/stop/republish the application on this server; all of these are happening from within Eclipse. This “Target runtime” is exactly what this thing does: it lets you associate your project with an already defined server or to define a new one. Click on the “New” button and you will see this wizard:
WTP supports the following J2EE servers: Tomcat, JBoss, WebSphere, JOnAS4, Oracle OC4J Standalone. From my experience the best for developing is the Tomcat: it is the fastest in terms of starting/ restarting/ redeploying. After you selected the desired server click “Next”.
In the second page of the wizard you need to browse for the server installation folder:
Click “Finish” and we are back to new Flex Project wizard. We select the target runtime from the combobox. If you choose on the first page to use LCDS, then on this page you need to browse for the path to Flex WAR file: if you want LCDS you should look for the file lcds.war under the installation folder and if you want BlazeDS you should look for blazeds.war under the blazeds folder. With this we are done and we can click “Finish”.
Once the project gets created you can play with the perspectives and change between Flex perspective and Java or J2EE perspective:
![]() |
![]() |
Run the project
So we have the project. Let’s see how can we run it. As I said before, WTP make this task child’s play. First thing we need is to be sure we have “Server” view displayed (if not you go to Window > Other Views… and select Server from the tree).
The first time you want to run a project you need to associate the project with the server - you do this only one time. You just right click inside the Flex application file and choose from the contextual menu Run As > Run on Server option:
This command will open this little wizard (you select the previously defined server and then click “Finish”):
After this the project gets compiled, the server is started and the project is deployed. At this point if you are looking inside the Server view you should be able to expand the Server node and see that a child exists with the same name as the project and the status of the server should be Started and Synchronized:
Now every time you change something in your project as soon you build the project, the project is redeployed automatically. And when you want to see the Flex application you choose Run As > Flex Application (the default browser is opened with the Flex application inside). Also because the project is associated with the server you can use the top right buttons from the Server view to start / stop / debug / publish.
This is it. In my next post I will talk about debugging Java and Flex code using this type of project.
Comments
21 Responses to “Creating a combined Flex/Java project in Flex Builder w/o LCDS/BlazeDS”
Leave a Reply











[...] my previous post I described how you can install WTP in Flex Builder and how you can create a combined Java/Flex [...]
[...] Neither do I (If you want to create a new Java/Flex project then check the my previous posts about creating a Java/Flex project and debugging this [...]
Very good
thanks
[...] Flex Builder and add the WTC plugin. Mihae Corlan has described the second option. In his post you can also find how to create a combined Flex/J2EE project and how to add the Tomcat [...]
[...] trying to use the FDS AJAX Bridge to push some messages in an AJAX grid. So I’ve created a Flex + WTP + BlazeDS project and went to change the default Application from the default MXML file to my FDMSBridge.as [...]
[...] can download it for a trial from here; if you don’t have WTP installed, then check my article here; finally if you don’t have LCDS, you can download it from here. I use a combined Flex and [...]
FlexLCDSDemo…
Intro The notes below should explain how to demo a Flex client using LiveCycle Data Services. Prerequisites You should have Tomcat (or other JEE web server) and ActiveMQ installed…….
Can you please write something about how to export a WAR file of the combined project? In eclipse, when doing a export/war the entire source code of flex is being added to the war file (even if you uncheck “Export source files”)
Other than that - excellent articles and thanks a million!
David
@David
There is a trick you can do. Just open the the file .settings/org.eclipse.wst.common.component from your project and comment the node with the attribute source-path=”/flex-src”.
This should solve your problem.
[...] Creio que ficou claro como criar um projeto Flex/Java + BlazeDS no Eclipse. Futuramente irei postar um outro tutorial ou screencast com um exemplo de comunicação Flex/Java. Este tutorial foi feito baseado nesse post. [...]
Merci, this helped a lot!
Hello!,
Good day!,
Hi David,
Would you please give me direction on how i can deploy both java and flex in one go. Flex and Java is deploy in weborb and weborb is then deploy in tomcat. What will be the setting for the J2EE server? Should i point to Weborb or the tomcat server?
[...] ago I was trying to use the FDS AJAX Bridge to push some messages in an AJAX grid. So I created a Flex + WTP + BlazeDS project and went to change the default Application from the default MXML file to my FDMSBridge.as [...]
[...] Creating a combined Flex/Java project in Flex Builder w/o LCDS/BlazeDS [...]
with flex builder 3 build-3.0.194161 i am not able to update WTP.
@prakash S
Thank you for telling me. Could you log a bug at http://bugs.adobe.com ?
many thanks!
There has come winter

It became cold and cloudy!
Mood very bad
Depression Begins
Depression Depression Depression aaaaaaaa
:( 
HEEEEELP
I hate winter! I want summer!