Search Flex Samples

Setting up the environment for Flex and Java development with Maven

To start developing Flex you have two choices: to use FlexBuilder or Flex plugin for Eclipse. As we would like to develop Flex and Java parallely, the Flex plugin approach is the only reasonable way to continue. At first you must have Eclipse (~100MB) installed. It can be obtained from here (must be at least version 3.3 or higher) and it must of course have Java development support. The plugin itself (~300MB) can be downloaded from here but you must have an Adobe ID to download it.

After downloading both of them, installing the Eclipse shouldn't be an obstacle as you only have to unzip it. Installing the Flex plugin should go easily either as the only thing it requires from you is the location of the Eclipse directory as shownhere. If everything went well then you could start the Eclipse. It asks you to create the workspace if it was the first time you started Eclipse or you hadn't checked the checkbox about asking the location of workspace and that's it, FlexBuilder plugin is installed and ready to be used.

As the next step you have to install Maven that can be found here. Download for example the apache-maven-2.0.8-bin.zip and unzip it to the directory you wish to install it. Next you'll have to define the maven home variable. For this push the (Windows key + Pause), select Advanced tab and push Environment Variable button. There you have to add three new User variables. Push New in the User variables window and insert M2_HOME as variable name and as variable value insert the path where you unzipped the Maven. The result should look similar to this. As the next variable you'll have to add M2 and the reference to the Maven bin folder like this. The last User variable is Path and it should have the value "%M2%;%Path%" like this. In addition to that you must have Java installed and JAVA_HOME correctly set. In case everything works correctly you should be able to execute from the command prompt the command "mvn -v" and this should give the following result.

To install the plugin you have to go to Help\Software Updates\Find and Install as can be seen on this screenshot. Next you have to choose "Search for new features to install" and you'll be directed to the screen of already installed Eclipse plugins. Now you have to push the button "New Remote Site", which will open the following screen. In this screen you'll have to put the following URL: "http://q4e.googlecode.com/svn/trunk/updatesite/" to the URL textbox. The name of the site can be anything self-explanatory for the future. Next you have to push OK and on the plugins screen push the button Finish. You are displayed the screen with Maven components that will be installed to Eclipse. Here you have to check checkbox in front of Maven2 and then you can move on by pushing the Next button. Now you are displayed all the components which will be updated during this update and the screen should look similar to this. Here you have accept the terms ob licence agreement below and then you can move on with next. You are once more displayed the components that will be installed but you could move on with the Finish button. Now you should see the Update manager downloading the components to be installed. In the end of downloading you are asked whether to install components by one or install all at once. You can push "Install all" here. After the installation the Eclipse has to be restarted and that's it - Eclipse is now integrated with Maven2 and FlexBuilder and ready for the Flex and Java.

0 comments:

Related Flex Samples

Learn Flex: Flex Samples | Flex Video Tutorials Flex Examples